Skip to content

Commit

Permalink
[release-v1.9] fix: Check if release branch exists (knative#133)
Browse files Browse the repository at this point in the history
* fix: Check if release branch exists

* Reflect review suggestion

---------

Co-authored-by: David Simansky <[email protected]>
  • Loading branch information
openshift-cherrypick-robot and dsimansk authored Apr 27, 2023
1 parent 09fec4a commit c446a24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion openshift/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,18 @@ install_knative_eventing_branch() {

install_serverless_operator_branch() {
local branch=$1
local repository="https://github.com/openshift-knative/serverless-operator.git"

if ! git ls-remote --heads --exit-code "$repository" "$branch" &>/dev/null; then
echo "Release branch doesn't exist yet, using main"
branch="main"
fi

local operator_dir=/tmp/serverless-operator
local failed=0
header "Installing serverless operator from openshift-knative/serverless-operator branch $branch"
rm -rf $operator_dir
git clone --branch $branch https://github.com/openshift-knative/serverless-operator.git $operator_dir || failed=1
git clone --branch $branch $repository $operator_dir || failed=1
pushd $operator_dir
# unset OPENSHIFT_BUILD_NAMESPACE (old CI) and OPENSHIFT_CI (new CI) as its used in serverless-operator's CI
# environment as a switch to use CI built images, we want pre-built images of k-s-o and k-o-i
Expand Down

0 comments on commit c446a24

Please sign in to comment.