Skip to content

Commit a8a1ae2

Browse files
committed
test(gateway): render two per-app listeners in the aliasing test
TestReconcile_ListenerAllowedRoutesNotAliased asserts that no two rendered listeners share one AllowedRoutes struct, but its HTTP-01 case published a single hostname. That branch renders per-app listeners one per published hostname, so the loop emitted exactly one and no two pointers could be equal: the assertion held whether or not the renderer copied. Dropping the DeepCopy at that site left the whole suite green. Publish two hostnames so the loop emits a pair. The same mutation now fails, which is what the test claimed to do all along. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent ddc782f commit a8a1ae2

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎internal/controller/tenantgateway/reconciler_test.go‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2638,7 +2638,12 @@ func TestReconcile_ListenerAllowedRoutesNotAliased(t *testing.T) {
26382638
}
26392639

26402640
r := &Reconciler{Scheme: newScheme(t)}
2641-
gw, err := r.renderGateway(tgw, []string{"app.foo.example.com"}, m.childApexes)
2641+
// Two published hostnames, not one: the HTTP-01 branch
2642+
// renders its per-app listeners from this list, so a single
2643+
// entry leaves that loop emitting one listener, where no
2644+
// two pointers can be equal and the assertion below holds
2645+
// no matter how the renderer builds them.
2646+
gw, err := r.renderGateway(tgw, []string{"app.foo.example.com", "www.foo.example.com"}, m.childApexes)
26422647
if err != nil {
26432648
t.Fatalf("renderGateway: %v", err)
26442649
}

0 commit comments

Comments
 (0)