Skip to content

Commit e3b5d72

Browse files
committed
test(kubernetes): name the Proxmox fixture's node pool <cluster>-<pool>
kubernetes-nodes names its release kubernetes-nodes-<CR name> and refuses to render one that does not start with kubernetes-nodes-<spec.cluster>- (_helpers.tpl, since 9afe7f1). 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 <[email protected]>
1 parent aed7fa8 commit e3b5d72

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

‎hack/e2e-chainsaw/kubernetes-proxmox/tenant.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ spec:
6565
apiVersion: apps.cozystack.io/v1alpha1
6666
kind: KubernetesNodes
6767
metadata:
68-
name: md0
68+
# <cluster>-<pool>: kubernetes-nodes refuses to render a release whose name
69+
# does not start with kubernetes-nodes-<spec.cluster>-, so a bare "md0" never
70+
# creates a Machine and the suite only times out waiting for one.
71+
name: k8s-e2e-md0
6972
namespace: tenant-e2eproxmox
7073
spec:
7174
cluster: k8s-e2e

‎hack/proxmox-e2e-fixture_test.bats‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ RUNNER="$REPO_ROOT/hack/e2e-chainsaw/_lib/run-proxmox.sh"
1616
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
1717
}
1818

19+
# kubernetes-nodes names its release kubernetes-nodes-<CR name> and refuses one
20+
# that does not start with kubernetes-nodes-<spec.cluster>- (_helpers.tpl), so a
21+
# pool named anything but <cluster>-<pool> fails at helm install and the suite
22+
# only learns it from a Machine that never appears.
23+
@test "the fixture's KubernetesNodes is named <cluster>-<pool>, as kubernetes-nodes requires" {
24+
doc="$(sed -n '/^kind: KubernetesNodes$/,/^---$/p' "$FIXTURE")"
25+
name="$(printf '%s\n' "$doc" | sed -n 's/^ name: *//p' | head -n 1 | tr -d '"')"
26+
cluster="$(printf '%s\n' "$doc" | sed -n 's/^ cluster: *//p' | head -n 1 | tr -d '"')"
27+
if [ -z "$name" ] || [ -z "$cluster" ]; then echo "FAIL: no KubernetesNodes name or spec.cluster in the fixture"; false; fi
28+
case "$name" in
29+
"$cluster"-?*) ;;
30+
*) echo "FAIL: KubernetesNodes $name must be named $cluster-<pool>"; false ;;
31+
esac
32+
}
33+
1934
@test "render-tenant expands every variable with the runner's defaults" {
2035
out="$(COZY_PVE_SSH=x COZY_PROXMOX_STORAGE=teststore "$RUNNER" render-tenant)"
2136
if printf '%s' "$out" | grep -q '\${'; then echo "FAIL: the rendered tenant must not keep an unexpanded variable"; false; fi

0 commit comments

Comments
 (0)