Skip to content

Commit cd28749

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 87daa3d commit cd28749

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,6 +3667,26 @@ YAML
36673667
local talos_block
36683668
talos_block=$(talos_spec_block)
36693669

3670+
# The kubernetes-worker-image catalog imports the golden Talos worker image into
3671+
# cozy-public once; the md0 nodeGroup below clones it (spec.nodeGroups.md0.image.
3672+
# builtin). This single factory import is the one #3231 exposure left after the
3673+
# per-worker talos-image-cache was dropped, so wait for it to finish importing
3674+
# here — a factory stall surfaces as a clear, self-contained failure instead of an
3675+
# opaque node-join timeout downstream, and the Kubernetes render (which fails when
3676+
# the golden is absent) is guaranteed a created source. The catalog HR is already
3677+
# Ready (install gate), so this waits only for the import phase to reach Succeeded.
3678+
echo "--- waiting for the golden Talos worker image(s) in cozy-public to import ---"
3679+
# Capture the DataVolume list inside the until condition and reuse it for the
3680+
# wait, so a transient get between "exists" and "wait" cannot skip the import
3681+
# check with an empty list.
3682+
timeout 12m sh -ec '
3683+
until dvs=$(kubectl -n cozy-public get datavolume -o name 2>/dev/null | grep talos-worker-); [ -n "$dvs" ]; do
3684+
echo "golden DataVolume not created yet; waiting..."; sleep 5
3685+
done
3686+
for dv in $dvs; do
3687+
echo "waiting for $dv import (phase=Succeeded)..."
3688+
kubectl -n cozy-public wait "$dv" --for=jsonpath="{.status.phase}"=Succeeded --timeout=10m
3689+
done'
36703690

36713691
kubectl apply -f - <<EOF
36723692
apiVersion: apps.cozystack.io/v1alpha1
@@ -3726,6 +3746,12 @@ ${ouroboros_addon}
37263746
md0:
37273747
diskSize: 20Gi
37283748
gpus: []
3749+
# Boot workers by CDI-cloning the shared golden Talos image in cozy-public
3750+
# (kubernetes-worker-image catalog, enabled in e2e-install-cozystack.bats)
3751+
# instead of a per-worker HTTP import — this exercises the clone path and the
3752+
# #3231 mitigation. builtin: {} clones the cluster talos.* default golden.
3753+
image:
3754+
builtin: {}
37293755
# Sizing comes from resources below; this is here because the values
37303756
# schema requires the field, and the chart drops the instancetype from
37313757
# the VM whenever a group sets both resources.cpu and resources.memory.

‎hack/e2e-install-cozystack.bats‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ spec:
204204
bundles:
205205
enabledPackages:
206206
- cozystack.external-dns-application
207+
# Golden Talos worker image catalog: the kubernetes suites set
208+
# nodeGroups.md0.image.builtin, so workers CDI-clone the golden in
209+
# cozy-public instead of each importing the OS image over HTTP. The
210+
# golden imports once from the factory (the single #3231 exposure),
211+
# replacing the removed per-worker talos-image-cache mirror.
212+
- cozystack.kubernetes-worker-image
207213
EOF
208214

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

0 commit comments

Comments
 (0)