Skip to content

Commit 7d829ae

Browse files
committed
prow-entrypoint: always prepare repos in cosa_init
PR #44 moved prepare_repos to cosa_init because 1. we want to take advantage of the $variant variable defined in this function and not have to define another time in cosa_build 2. it feel the right place to fetch the repos during the cosa init operation. But, as prepare_repos is placed after testing the existence of the 'builds' directory, the repos are not fetch when already in an intilialized cosa dir. This changes the behavior by always fetching the repos during the cosa_init process.
1 parent a0131ea commit 7d829ae

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ci/prow-entrypoint.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@ setup_user() {
3333
# Setup a new build directory with COSA init, selecting the version of RHEL or
3434
# CentOS Stream that we want as a basis for RHCOS/SCOS.
3535
cosa_init() {
36-
if test -d builds; then
37-
echo "Already in an initialized cosa dir"
38-
return
39-
fi
40-
4136
if [[ ${#} -ne 1 ]]; then
4237
echo "This should have been called with a single 'variant' argument"
4338
exit 1
4439
fi
4540
local -r variant="${1}"
4641
echo "Using variant: ${variant}"
4742

43+
if test -d builds; then
44+
echo "Already in an initialized cosa dir"
45+
# Pull repos from an in-cluster service of the Openshift CI
46+
prepare_repos "${variant}"
47+
return
48+
fi
49+
4850
# Always create a writable copy of the source repo
4951
tmp_src="$(mktemp -d)"
5052
cp -a /src "${tmp_src}/os"

0 commit comments

Comments
 (0)