Skip to content

Commit 43c9eb6

Browse files
committed
test(engine): clarify floatingIP-strip test contract comment
Address review feedback from gemini-code-assist on pkg/engine/contract_network_multidoc_test.go:339: the previous comment claimed the test picked a VIP that did NOT match any discovery address, contradicting both the trailing comment on line 341 and the test body — which intentionally sets the VIP to the same host as the discovered address so the strip path actually fires. Comment rewritten to describe the real intent. Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 5d93f1d commit 43c9eb6

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

‎pkg/engine/contract_network_multidoc_test.go‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,13 @@ func TestContract_NetworkMultidoc_Layer2VIPOverrideOnFreshNode(t *testing.T) {
330330
// Layer2VIPConfig target).
331331
//
332332
// Test setup: simpleNicLookup carries 192.168.201.10/24 on eth0. We
333-
// declare the same address as the VIP (host portion only; the chart
334-
// strips by `<floatingIP>/` prefix). The address should still appear
335-
// once for the floatingIP being declared at all (Layer2VIPConfig.name)
336-
// but NOT as `- address: 192.168.201.10/24` under LinkConfig.addresses.
337-
//
338-
// Picking a VIP that does not match any discovery address makes the
339-
// test robust against future discovery fixture changes.
333+
// deliberately set floatingIP to the SAME host address (192.168.201.10)
334+
// so the strip path actually fires — the chart filters per-link
335+
// addresses by `<floatingIP>/` prefix, so a VIP that matches no
336+
// discovered address would not exercise the filter. The address must
337+
// appear once at Layer2VIPConfig.name (the VIP declaration itself),
338+
// but MUST NOT appear under LinkConfig.addresses as a regular address.
340339
func TestContract_NetworkMultidoc_FloatingIPStrippedFromLinkAddresses(t *testing.T) {
341-
// Pick a VIP that DOES match the discovery address, then assert
342-
// it is NOT in LinkConfig.addresses.
343340
out := renderCozystackWith(t, simpleNicLookup(), map[string]any{
344341
"floatingIP": "192.168.201.10",
345342
"advertisedSubnets": []any{testAdvertisedSubnet},

0 commit comments

Comments
 (0)