实现一次性 Pod Runner 后端
test / python (pull_request) Successful in 9s
test / shell (pull_request) Successful in 15s

This commit is contained in:
2026-09-16 14:26:07 +00:00
parent 70f0380a3d
commit 4277bd907a
8 changed files with 482 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
set -eu
socket=${SPIRE_AGENT_SOCKET:-/run/spire/agent-sockets/spire-agent.sock}
wait_seconds=${SPIFFE_IDENTITY_WAIT_SECONDS:-60}
deadline=$(( $(date +%s) + wait_seconds ))
while [ "$(date +%s)" -lt "$deadline" ]; do
if timeout 2 /opt/spire/bin/spire-agent api fetch jwt \
-audience ci-job-ready \
-socketPath "$socket" \
>/dev/null 2>&1; then
exit 0
fi
sleep 1
done
echo "timed out waiting for the job SPIFFE identity" >&2
exit 1