Only launch ssh agent if ssh keys are mounted in tekton.
This commit is contained in:
parent
3411d0cd39
commit
7ee31a1852
@ -77,9 +77,13 @@ spec:
|
||||
#!/usr/bin/env sh
|
||||
#
|
||||
set -euo pipefail
|
||||
if [ -n "\$(find /tekton/creds/.ssh -maxdepth 1 -name 'id_*' -print -quit)" ]; then
|
||||
eval \$(ssh-agent)
|
||||
ssh-add /tekton/creds/.ssh/id_*
|
||||
exec buildctl-daemonless.sh build --ssh default=\$SSH_AUTH_SOCK "\${@}"
|
||||
else
|
||||
exec buildctl-daemonless.sh build "\${@}"
|
||||
fi
|
||||
EOF
|
||||
chmod +x /home/user/.config/buildkit/entrypoint.sh
|
||||
volumeMounts:
|
||||
|
Loading…
Reference in New Issue
Block a user