From 28d9d352e1c796c8ad769d6857020ee72d611672 Mon Sep 17 00:00:00 2001 From: Marian Koreniuk Date: Tue, 20 Oct 2026 12:17:24 +0200 Subject: [PATCH] test(kubernetes): name the Proxmox fixture's node pool - kubernetes-nodes names its release kubernetes-nodes- and refuses to render one that does not start with kubernetes-nodes-- (_helpers.tpl, since fd14126be). The Proxmox fixture named its KubernetesNodes "md0", so helm install of the pool failed, no Machine was ever created, and the first real run of the lane on a self-hosted stand timed out on the Machine assert after 20 minutes. Name the pool k8s-e2e-md0 and add a fixture test that fails on any name the chart would refuse. Assisted-by: LLM Signed-off-by: Marian Koreniuk --- hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml | 5 ++++- hack/proxmox-e2e-fixture_test.bats | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml b/hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml index 4cb453e5c..76e6e46fd 100644 --- a/hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml +++ b/hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml @@ -65,7 +65,10 @@ spec: apiVersion: apps.cozystack.io/v1alpha1 kind: KubernetesNodes metadata: - name: md0 + # -: kubernetes-nodes refuses to render a release whose name + # does not start with kubernetes-nodes--, so a bare "md0" never + # creates a Machine and the suite only times out waiting for one. + name: k8s-e2e-md0 namespace: tenant-e2eproxmox spec: cluster: k8s-e2e diff --git a/hack/proxmox-e2e-fixture_test.bats b/hack/proxmox-e2e-fixture_test.bats index 0d2df3e5a..5ec7ae8dc 100755 --- a/hack/proxmox-e2e-fixture_test.bats +++ b/hack/proxmox-e2e-fixture_test.bats @@ -16,6 +16,21 @@ RUNNER="$REPO_ROOT/hack/e2e-chainsaw/_lib/run-proxmox.sh" if grep -qE '\$\{[A-Za-z_]+:[-=?+]' "$FIXTURE"; then echo "FAIL: the fixture must not carry a shell-style default envsubst leaves in place"; false; fi } +# kubernetes-nodes names its release kubernetes-nodes- and refuses one +# that does not start with kubernetes-nodes-- (_helpers.tpl), so a +# pool named anything but - fails at helm install and the suite +# only learns it from a Machine that never appears. +@test "the fixture's KubernetesNodes is named -, as kubernetes-nodes requires" { + doc="$(sed -n '/^kind: KubernetesNodes$/,/^---$/p' "$FIXTURE")" + name="$(printf '%s\n' "$doc" | sed -n 's/^ name: *//p' | head -n 1 | tr -d '"')" + cluster="$(printf '%s\n' "$doc" | sed -n 's/^ cluster: *//p' | head -n 1 | tr -d '"')" + if [ -z "$name" ] || [ -z "$cluster" ]; then echo "FAIL: no KubernetesNodes name or spec.cluster in the fixture"; false; fi + case "$name" in + "$cluster"-?*) ;; + *) echo "FAIL: KubernetesNodes $name must be named $cluster-"; false ;; + esac +} + @test "render-tenant expands every variable with the runner's defaults" { out="$(COZY_PVE_SSH=x COZY_PROXMOX_STORAGE=teststore "$RUNNER" render-tenant)" if printf '%s' "$out" | grep -q '\${'; then echo "FAIL: the rendered tenant must not keep an unexpanded variable"; false; fi