Skip to content

Commit

Permalink
ci/prow-entrypoint: tell git repo under /src is safe
Browse files Browse the repository at this point in the history
That directory is part of the image and so not owned by us. Likely the
base image used for the src container was updated recently to include
newer git.
  • Loading branch information
jlebon committed May 22, 2024
1 parent 55abc92 commit 4e631c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/prow-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,18 @@ validate() {
workdir="$(mktemp -d)"
echo "Using $workdir as working directory"

# for `git config --global` below
export HOME=${workdir}

# Figure out if we are running from the COSA image or directly from the Prow src image
if [[ -d /src/github.com/openshift/os ]]; then
cd "$workdir"
git config --global --add safe.directory /src/github.com/openshift/os
git clone /src/github.com/openshift/os os
elif [[ -d ./.git ]]; then
srcdir="${PWD}"
cd "$workdir"
git config --global --add safe.directory "${srcdir}"
git clone "${srcdir}" os
else
echo "Could not found source directory"
Expand Down

0 comments on commit 4e631c6

Please sign in to comment.