16 lines
516 B
Python
16 lines
516 B
Python
"""Shared helpers for CKA task banks."""
|
|
|
|
NS = r"""
|
|
mkns() { $K create ns "$1" --dry-run=client -o yaml | $K apply -f - >/dev/null; }
|
|
"""
|
|
|
|
def C(name, pts, script):
|
|
return {"name": name, "pts": pts, "script": script}
|
|
|
|
def ns_pick(r, base):
|
|
"""Namespace name with a random suffix so the same task never lands on the same namespace twice."""
|
|
return f"{base}-{r.choice(['alpha', 'bravo', 'delta', 'echo', 'kilo', 'nova', 'omega', 'zulu'])}"
|
|
|
|
def name_pick(r, base):
|
|
return f"{base}-{r.randint(10, 99)}"
|