fix(ops): list live region pods with a go-template in fault-drill

kubectl jsonpath has no negation, so the deletionTimestamp filter was a
parse error on every call. Use a go-template that skips pods already
being deleted; verified against sample pods with Go's text/template,
which kubectl's go-template output uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-30 14:37:17 -04:00
co-authored by Claude Opus 5.5
parent 161864f1f0
commit 6b5da397e8
+2 -1
View File
@@ -43,7 +43,8 @@ now_ms() { date +%s%3N; }
say() { echo "$(date -u +%H:%M:%S) $*"; }
fail() { say "FAIL $*"; exit 1; }
current_pods() { "${k[@]}" get pods -n "$ns" -l "$selector" \
-o jsonpath='{range .items[?(!@.metadata.deletionTimestamp)]}{.metadata.name}{"\n"}{end}'; }
-o go-template='{{range .items}}{{if not .metadata.deletionTimestamp}}{{.metadata.name}}{{"\n"}}{{end}}{{end}}'; }
# (kubectl jsonpath has no negation; the go-template skips pods already being deleted.)
ready_pod() { # Waits up to $2 seconds (default 120) for a Ready pod other than $1.
local old="$1" limit="${2:-120}"
for _ in $(seq 1 $((limit * 5))); do