pilot-run.sh: poll the Job instead of kubectl wait with two --for (ANDed; hung after the completed run)
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 523928@bnt-lap001
Assistant-Session: 6c737afb-9c14-4152-9f02-477214b9c350
This commit is contained in:
tegwick 2026-11-05 09:45:00 +01:00
parent e181fb0cfb
commit 216a5db55c

View file

@ -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"