实现一次性 Pod Runner 后端
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user