fix(module,app): handle non existent interface in app url resolver
arcad/emissary/pipeline/head This commit looks good Details

This commit is contained in:
wpetit 2023-04-06 15:55:51 +02:00
parent 9dcddc5566
commit b213b8d1ae
2 changed files with 4 additions and 1 deletions

View File

@ -151,6 +151,8 @@ func createResolveAppURL(specs *spec.Spec) (ResolveAppURLFunc, error) {
ctx, "could not find interface", ctx, "could not find interface",
logger.E(errors.WithStack(err)), logger.F("iface", ifaceName), logger.E(errors.WithStack(err)), logger.F("iface", ifaceName),
) )
continue
} }
addresses, err := iface.Addrs() addresses, err := iface.Addrs()

View File

@ -19,7 +19,8 @@ func TestCreateResolveAppURL(t *testing.T) {
Config: &spec.Config{ Config: &spec.Config{
AppURLResolving: &spec.AppURLResolving{ AppURLResolving: &spec.AppURLResolving{
IfaceMappings: map[string]string{ IfaceMappings: map[string]string{
"lo": "http://{{ .DeviceIP }}:{{ .AppPort }}", "lo": "http://{{ .DeviceIP }}:{{ .AppPort }}",
"does-not-exists": "http://{{ .DeviceIP }}:{{ .AppPort }}",
}, },
DefaultURLTemplate: `http://{{ last ( splitList "." ( toString .Manifest.ID ) ) }}.arcad.local`, DefaultURLTemplate: `http://{{ last ( splitList "." ( toString .Manifest.ID ) ) }}.arcad.local`,
}, },