diff --git a/internal/api/v1/handlers_reconciliation_test.go b/internal/api/v1/handlers_reconciliation_test.go index 4bfc812..b1b7186 100644 --- a/internal/api/v1/handlers_reconciliation_test.go +++ b/internal/api/v1/handlers_reconciliation_test.go @@ -1,6 +1,7 @@ package v1 import ( + "fmt" "strings" "testing" @@ -271,12 +272,14 @@ func TestReconciliation_CentralDomainInHAProxy(t *testing.T) { } } - // Central domain goes first (as reconcileNetworking does) + // Central domain goes first (as reconcileNetworking does). + // Uses port 15055 — must match the running port, NOT default 5055. centralDomain := "central.payne.io" + centralPort := 15055 httpRoutes = append([]haproxy.HTTPRoute{{ Name: "wild-central", Domain: centralDomain, - Backend: "127.0.0.1:5055", + Backend: fmt.Sprintf("127.0.0.1:%d", centralPort), }}, httpRoutes...) cfg := api.haproxy.GenerateWithOpts(nil, nil, haproxy.GenerateOpts{ @@ -291,6 +294,14 @@ func TestReconciliation_CentralDomainInHAProxy(t *testing.T) { t.Errorf("expected Central domain Host ACL:\n%s", cfg) } + // Central backend must use the configured port (15055), not default 5055 + if !strings.Contains(cfg, "server s0 127.0.0.1:15055") { + t.Errorf("Central backend must use port 15055, not 5055:\n%s", cfg) + } + if strings.Contains(cfg, "server s0 127.0.0.1:5055") { + t.Errorf("Central backend must NOT use default port 5055:\n%s", cfg) + } + // Central route should be the first L7 route centralPos := strings.Index(cfg, "is_l7_wild_central") appPos := strings.Index(cfg, "is_l7_my_app_payne_io")