From ac47cf0f6c0fffb2f78e2b37e7700f7d331e684d Mon Sep 17 00:00:00 2001 From: vumast3r Date: Fri, 18 Sep 2026 11:10:23 -0600 Subject: [PATCH] refactor: fixed some errors while deploying the cluster --- tracks/cka/common.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tracks/cka/common.py b/tracks/cka/common.py index 99620a1..58491f8 100644 --- a/tracks/cka/common.py +++ b/tracks/cka/common.py @@ -1,7 +1,15 @@ """Shared helpers for CKA task banks.""" NS = r""" -mkns() { $K create ns "$1" --dry-run=client -o yaml | $K apply -f - >/dev/null; } +mkns() { + $K create ns "$1" --dry-run=client -o yaml | $K apply -f - >/dev/null + # Wait for the namespace's `default` ServiceAccount before returning. The controller creates it + # asynchronously, and a Pod applied in the gap is rejected outright: + # error looking up service account /default: serviceaccount "default" not found + # Setups that create a namespace and immediately apply Pods lose that race under load (Q204), + # which fails the seed and costs the candidate a whole task. It belongs here, not in each task. + for _ in $(seq 1 30); do $K -n "$1" get sa default >/dev/null 2>&1 && return 0; sleep 1; done +} """ def C(name, pts, script):