From 216a5db55cdd8df4387b6895f97a6ce2b24d1634 Mon Sep 17 00:00:00 2001 From: tegwick Date: Thu, 5 Nov 2026 09:45:00 +0100 Subject: [PATCH] pilot-run.sh: poll the Job instead of kubectl wait with two --for (ANDed; hung after the completed run) Co-Authored-By: Claude Opus 5.5 Assistant: claude-code Assistant-Model: opus Assistant-Process: 523928@bnt-lap001 Assistant-Session: 6c737afb-9c14-4152-9f02-477214b9c350 --- sso-mfa/k8s/bounded-executor/pilot-run.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sso-mfa/k8s/bounded-executor/pilot-run.sh b/sso-mfa/k8s/bounded-executor/pilot-run.sh index 8504605..85fa26f 100755 --- a/sso-mfa/k8s/bounded-executor/pilot-run.sh +++ b/sso-mfa/k8s/bounded-executor/pilot-run.sh @@ -26,6 +26,11 @@ CFG=$(mktemp --suffix=.json) python3 -c "import json,sys; c=json.load(open(sys.argv[1])); c['trust_satisfied']=['runtime_secret_trust','runtime_identity_trust']; json.dump(c, open(sys.argv[2],'w'), indent=2)" "$RAPP/examples/config.pilot.json" "$CFG" $K -n sso delete job "$JOB" --ignore-not-found >/dev/null; $K -n sso delete configmap "$JOB" --ignore-not-found >/dev/null (cd "$RAPP" && make run ADMISSION="$A" APPROVAL_ID="$APPROVAL" CONFIG="$CFG" KUBECTL="$K") -$K -n sso wait --for=condition=complete --for=condition=failed "job/$JOB" --timeout=1500s +# Either condition ends the wait (kubectl wait ANDs repeated --for; seen 2026-11-05, the completed run hung it). +for _ in $(seq 1 300); do + st=$($K -n sso get "job/$JOB" -o jsonpath='{.status.succeeded}{.status.failed}') + [ -n "$st" ] && break + sleep 5 +done $K -n sso logs "job/$JOB" > "$E/$(printf %02d $((n + 2)))-result.json" tail -40 "$E/$(printf %02d $((n + 2)))-result.json"