Commit 2ad2aac
committed
Fix VCS stamping error in containerized builds with Podman
This commit addresses issue #9004 by adding git safe.directory configuration
to fix 'dubious ownership' errors that occur when using Podman as the
container runtime for builds.
The issue was caused by a directory ownership mismatch where the mounted
repository directory (/github.com/vmware-tanzu/velero) is owned by root:root
but the files inside are owned by the mapped user. This triggers Git's
security feature and causes VCS stamping to fail with exit code 128.
Changes:
- Add .gitconfig file with safe.directory configuration for the mounted path
- Mount .gitconfig as read-only volume in the shell target
- This allows Git operations to work properly inside the container
The fix is minimal, targeted, and maintains VCS stamping functionality
while being compatible with both Docker and Podman container runtimes.
Fixes #90041 parent 90d13bb commit 2ad2aac
2 files changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
0 commit comments