fix(argo): add git safe.directory for PVC-persisted checkout

The cargo-target PVC retains the source checkout between workflow runs.
When the container UID differs from the PVC owner, git refuses to operate
with "dubious ownership" error. Adding safe.directory resolves this.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-03-12 08:26:11 +01:00
parent 38178a6602
commit 2245e347c9

View File

@@ -179,6 +179,9 @@ spec:
REPO="ssh://git@gitlab-gitlab-shell.foxhunt.svc.cluster.local:2222/root/foxhunt.git"
BUILD="/cargo-target/src"
# PVC may be owned by a different UID from a previous run
git config --global --add safe.directory "$BUILD"
# Persistent checkout on PVC — only changed files get new mtimes,
# so cargo skips recompiling unchanged workspace crates.
if [ -d "$BUILD/.git" ]; then