From 2e701173c82d467a7761eda3d5189a5f1ed03753 Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Wed, 18 Nov 2026 10:51:09 +0100 Subject: [PATCH] test(cozyplane): pin the args the platform's networking facts reach The platform threads podCIDR, serviceCIDR and clusterDNS into the cozyplane chart, and they carry the masquerade and the VPCs' internal denies. A template that dropped one still rendered and every suite stayed green. The suite now asserts the agent's --cluster-cidr, --masquerade, --internal-cidrs and --mtu and the controller's --internal-cidrs and --cluster-dns, using non-default values so a chart default cannot stand in for a lost one. Assisted-by: LLM Signed-off-by: Timofei Larkin --- .../cozyplane/tests/egress_args_test.yaml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 packages/system/cozyplane/tests/egress_args_test.yaml diff --git a/packages/system/cozyplane/tests/egress_args_test.yaml b/packages/system/cozyplane/tests/egress_args_test.yaml new file mode 100644 index 000000000..0212ea3c5 --- /dev/null +++ b/packages/system/cozyplane/tests/egress_args_test.yaml @@ -0,0 +1,52 @@ +suite: the platform's networking facts reach the agent and the controller +# The platform threads networking.podCIDR, serviceCIDR and clusterDNS into +# cozyplane.egress. These args carry the masquerade and the VPCs' internal +# denies; a template that drops one still renders, with the wrong egress. +# Non-default values, so a chart default cannot stand in for a lost one. +templates: + - charts/cozyplane/templates/agent.yaml + - charts/cozyplane/templates/controller.yaml +release: + name: cozyplane + namespace: cozy-cozyplane +set: + cozyplane: + mtu: 1400 + egress: + clusterCIDR: 192.168.0.0/17 + serviceCIDR: 172.20.0.0/16 + clusterDNS: 172.20.0.10 + internalCIDRs: + - 10.8.0.0/24 +tests: + - it: gives the agent the pod supernet, the masquerade and every internal range + template: charts/cozyplane/templates/agent.yaml + documentSelector: + path: kind + value: DaemonSet + asserts: + - contains: + path: spec.template.spec.containers[0].args + content: "--cluster-cidr=192.168.0.0/17" + - contains: + path: spec.template.spec.containers[0].args + content: "--masquerade=bpf" + - contains: + path: spec.template.spec.containers[0].args + content: "--internal-cidrs=192.168.0.0/17,172.20.0.0/16,10.8.0.0/24" + - contains: + path: spec.template.spec.containers[0].args + content: "--mtu=1400" + + - it: gives the controller the internal ranges and the cluster DNS + template: charts/cozyplane/templates/controller.yaml + documentSelector: + path: kind + value: Deployment + asserts: + - contains: + path: spec.template.spec.containers[0].args + content: "--internal-cidrs=192.168.0.0/17,172.20.0.0/16,10.8.0.0/24" + - contains: + path: spec.template.spec.containers[0].args + content: "--cluster-dns=172.20.0.10"