Skip to content

Commit

Permalink
Merge pull request #1219 from SaschaSchwarze0/sascha-ko-tolerate-dire…
Browse files Browse the repository at this point in the history
…ctory-owner-mismatch

Allow non-current user to own the directory which is built by ko
  • Loading branch information
openshift-merge-robot authored Feb 27, 2023
2 parents 30ec174 + 22675cd commit fb8dee7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions samples/buildstrategy/ko/buildstrategy_ko_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
value: $(params.shp-output-image)
- name: PARAM_SOURCE_CONTEXT
value: $(params.shp-source-context)
- name: PARAM_SOURCE_ROOT
value: $(params.shp-source-root)
- name: PARAM_TARGET_PLATFORM
value: $(params.target-platform)
- name: PARAM_PACKAGE_DIRECTORY
Expand Down Expand Up @@ -135,6 +137,11 @@ spec:
go version
echo "ko version $(/tmp/ko version)"
# Allow directory to be owned by other user which is normal for a volume-mounted directory.
# This allows Go to run git commands to access repository metadata.
# Documentation: https://git-scm.com/docs/git-config/2.39.0#Documentation/git-config.txt-safedirectory
git config --global --add safe.directory "${PARAM_SOURCE_ROOT}"
# Run ko
export GOROOT="$(go env GOROOT)"
Expand Down

0 comments on commit fb8dee7

Please sign in to comment.