Skip to content

Commit 8725e77

Browse files
test(e2e): exercise the golden-image clone path in the kubernetes suites
The image-cache removal assumed workers clone by default, but the clone is opt-in per node group. Enable the cozystack.kubernetes-worker-image catalog in the e2e install and set nodeGroups.md0.image.builtin on the worker-spinning kubernetes CR, so the suites take the CDI clone path instead of a per-worker HTTP import — delivering the #3231 mitigation the cache used to provide. The golden imports once from the factory and every worker clones it, so a separate cache mirror is redundant. Wait for the golden DataVolume to reach Succeeded before applying the tenant CR (capturing the DV list once so a transient get cannot skip the wait): it is the single remaining factory dependency, so a stall surfaces as a clear failure rather than an opaque node-join timeout, and the render (which fails when the golden is absent) is guaranteed a created source. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent b2fd9df commit 8725e77

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

‎hack/e2e-chainsaw/_lib/run-kubernetes.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,27 @@ YAML
252252
)
253253
fi
254254

255+
# The kubernetes-worker-image catalog imports the golden Talos worker image into
256+
# cozy-public once; the md0 nodeGroup below clones it (spec.nodeGroups.md0.image.
257+
# builtin). This single factory import is the one #3231 exposure left after the
258+
# per-worker talos-image-cache was dropped, so wait for it to finish importing
259+
# here — a factory stall surfaces as a clear, self-contained failure instead of an
260+
# opaque node-join timeout downstream, and the Kubernetes render (which fails when
261+
# the golden is absent) is guaranteed a created source. The catalog HR is already
262+
# Ready (install gate), so this waits only for the import phase to reach Succeeded.
263+
echo "--- waiting for the golden Talos worker image(s) in cozy-public to import ---"
264+
# Capture the DataVolume list inside the until condition and reuse it for the
265+
# wait, so a transient get between "exists" and "wait" cannot skip the import
266+
# check with an empty list.
267+
timeout 12m sh -ec '
268+
until dvs=$(kubectl -n cozy-public get datavolume -o name 2>/dev/null | grep talos-worker-); [ -n "$dvs" ]; do
269+
echo "golden DataVolume not created yet; waiting..."; sleep 5
270+
done
271+
for dv in $dvs; do
272+
echo "waiting for $dv import (phase=Succeeded)..."
273+
kubectl -n cozy-public wait "$dv" --for=jsonpath="{.status.phase}"=Succeeded --timeout=10m
274+
done'
275+
255276
kubectl apply -f - <<EOF
256277
apiVersion: apps.cozystack.io/v1alpha1
257278
kind: Kubernetes
@@ -303,6 +324,12 @@ ${ouroboros_addon}
303324
md0:
304325
diskSize: 20Gi
305326
gpus: []
327+
# Boot workers by CDI-cloning the shared golden Talos image in cozy-public
328+
# (kubernetes-worker-image catalog, enabled in e2e-install-cozystack.bats)
329+
# instead of a per-worker HTTP import — this exercises the clone path and the
330+
# #3231 mitigation. builtin: {} clones the cluster talos.* default golden.
331+
image:
332+
builtin: {}
306333
instanceType: u1.medium
307334
maxReplicas: 10
308335
minReplicas: 2

‎hack/e2e-install-cozystack.bats‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ spec:
125125
bundles:
126126
enabledPackages:
127127
- cozystack.external-dns-application
128+
# Golden Talos worker image catalog: the kubernetes suites set
129+
# nodeGroups.md0.image.builtin, so workers CDI-clone the golden in
130+
# cozy-public instead of each importing the OS image over HTTP. The
131+
# golden imports once from the factory (the single #3231 exposure),
132+
# replacing the removed per-worker talos-image-cache mirror.
133+
- cozystack.kubernetes-worker-image
128134
EOF
129135

130136
# Launch storage + LB configuration in the background. It waits for its

0 commit comments

Comments
 (0)