Skip to content

Commit c80f8e5

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 28bd3a8 commit c80f8e5

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
@@ -4076,6 +4076,26 @@ YAML
40764076
local talos_block
40774077
talos_block=$(talos_spec_block)
40784078

4079+
# The kubernetes-worker-image catalog imports the golden Talos worker image into
4080+
# cozy-public once; the md0 nodeGroup below clones it (spec.nodeGroups.md0.image.
4081+
# builtin). This single factory import is the one #3231 exposure left after the
4082+
# per-worker talos-image-cache was dropped, so wait for it to finish importing
4083+
# here — a factory stall surfaces as a clear, self-contained failure instead of an
4084+
# opaque node-join timeout downstream, and the Kubernetes render (which fails when
4085+
# the golden is absent) is guaranteed a created source. The catalog HR is already
4086+
# Ready (install gate), so this waits only for the import phase to reach Succeeded.
4087+
echo "--- waiting for the golden Talos worker image(s) in cozy-public to import ---"
4088+
# Capture the DataVolume list inside the until condition and reuse it for the
4089+
# wait, so a transient get between "exists" and "wait" cannot skip the import
4090+
# check with an empty list.
4091+
timeout 12m sh -ec '
4092+
until dvs=$(kubectl -n cozy-public get datavolume -o name 2>/dev/null | grep talos-worker-); [ -n "$dvs" ]; do
4093+
echo "golden DataVolume not created yet; waiting..."; sleep 5
4094+
done
4095+
for dv in $dvs; do
4096+
echo "waiting for $dv import (phase=Succeeded)..."
4097+
kubectl -n cozy-public wait "$dv" --for=jsonpath="{.status.phase}"=Succeeded --timeout=10m
4098+
done'
40794099

40804100
kubectl apply -f - <<EOF
40814101
apiVersion: apps.cozystack.io/v1alpha1
@@ -4135,6 +4155,12 @@ ${ouroboros_addon}
41354155
md0:
41364156
diskSize: 20Gi
41374157
gpus: []
4158+
# Boot workers by CDI-cloning the shared golden Talos image in cozy-public
4159+
# (kubernetes-worker-image catalog, enabled in e2e-install-cozystack.bats)
4160+
# instead of a per-worker HTTP import — this exercises the clone path and the
4161+
# #3231 mitigation. builtin: {} clones the cluster talos.* default golden.
4162+
image:
4163+
builtin: {}
41384164
# Sizing comes from resources below; this is here because the values
41394165
# schema requires the field, and the chart drops the instancetype from
41404166
# 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)