From 47c2546d5499e20dee1d1a4d1de84f96f383feb4 Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 6 Apr 2023 18:25:34 +0200 Subject: [PATCH] fix(controller,app): break loop when app is found --- internal/agent/controller/app/app_handler.go | 1 + internal/agent/controller/app/app_handler_test.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/internal/agent/controller/app/app_handler.go b/internal/agent/controller/app/app_handler.go index 2d9bcfd..23c0140 100644 --- a/internal/agent/controller/app/app_handler.go +++ b/internal/agent/controller/app/app_handler.go @@ -205,6 +205,7 @@ func createResolveAppURL(specs *spec.Spec) (ResolveAppURLFunc, error) { } appEntry = &entry + break } if appEntry == nil { diff --git a/internal/agent/controller/app/app_handler_test.go b/internal/agent/controller/app/app_handler_test.go index 14a23c9..ed20e82 100644 --- a/internal/agent/controller/app/app_handler_test.go +++ b/internal/agent/controller/app/app_handler_test.go @@ -15,6 +15,12 @@ func TestCreateResolveAppURL(t *testing.T) { "app.arcad.test": { Address: ":8080", }, + "app.arcad.foo": { + Address: ":8081", + }, + "app.arcad.bar": { + Address: ":8082", + }, }, Config: &spec.Config{ AppURLResolving: &spec.AppURLResolving{