TestMultiDocCozystack_VIPLinkOverride pins the chicken-and-egg fix for nodes that need the VIP on a link that does not yet exist on the live system at first apply (typical case: a VLAN sub-interface that the same template is about to bring up). Without an override the chart would derive vipLink from
(t *testing.T)
| 7250 | // .Values.vipLink lets the operator declare the target link up front |
| 7251 | // so the rendered Layer2VIPConfig matches the post-apply network. |
| 7252 | func TestMultiDocCozystack_VIPLinkOverride(t *testing.T) { |
| 7253 | result := renderCozystackWith(t, simpleNicLookup(), map[string]any{ |
| 7254 | "floatingIP": "192.168.201.5", |
| 7255 | "vipLink": "eth0.4000", |
| 7256 | }) |
| 7257 | |
| 7258 | assertContains(t, result, "kind: Layer2VIPConfig") |
| 7259 | assertContains(t, result, "link: eth0.4000") |
| 7260 | assertNotContains(t, result, "link: eth0\n") |
| 7261 | |
| 7262 | // Override-path Layer2VIPConfig must emit exactly once. The |
| 7263 | // discovery-derived block is gated on `not .Values.vipLink`, so |
| 7264 | // no second document with link: eth0 should appear alongside |
| 7265 | // the override. |
| 7266 | if c := strings.Count(result, "kind: Layer2VIPConfig"); c != 1 { |
| 7267 | t.Errorf("expected exactly one Layer2VIPConfig document, got %d:\n%s", c, result) |
| 7268 | } |
| 7269 | } |
| 7270 | |
| 7271 | // TestMultiDocCozystack_VIPLinkOverrideOnFreshNode pins the |
| 7272 | // fresh-node case for the vipLink override: a node with no |
nothing calls this directly
no test coverage detected