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