refactor: fixed some errors while deploying the cluster
This commit is contained in:
parent
65c2fbfd43
commit
ac47cf0f6c
@ -1,7 +1,15 @@
|
|||||||
"""Shared helpers for CKA task banks."""
|
"""Shared helpers for CKA task banks."""
|
||||||
|
|
||||||
NS = r"""
|
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 <ns>/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):
|
def C(name, pts, script):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user