diff --git a/tools/ops/fault-drill.sh b/tools/ops/fault-drill.sh index 7cee41c..48cf3b4 100644 --- a/tools/ops/fault-drill.sh +++ b/tools/ops/fault-drill.sh @@ -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