Skip to content

Commit

Permalink
Remove _wrapper from oc login
Browse files Browse the repository at this point in the history
  • Loading branch information
gburges committed Jan 4, 2024
1 parent 529b7f4 commit e3963f0
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,7 @@ add_cicd_bin_to_path() {
if ! command -v oc_wrapper; then export PATH=$PATH:${CICD_ROOT}/bin; fi
}

check_available_server() {
echo "Checking connectivity to ephemeral cluster ..."
(curl -s $OC_LOGIN_SERVER > /dev/null)
RET_CODE=$?
if [ $RET_CODE -ge 1 ]; then echo "Connectivity check failed"; fi
return $RET_CODE
}

# Hotswap based on availability
login_to_available_server() {
if check_available_server; then
# log in to ephemeral cluster
oc_wrapper login --token=$OC_LOGIN_TOKEN --server=$OC_LOGIN_SERVER
echo "logging in to Ephemeral cluster"
else
# switch to crcd cluster
oc_wrapper login --token=$OC_LOGIN_TOKEN_DEV --server=$OC_LOGIN_SERVER_DEV
echo "logging in to CRCD cluster"
fi
}

add_cicd_bin_to_path

login_to_available_server
echo "logging in to CRCD cluster"
oc_wrapper login --token=$OC_LOGIN_TOKEN_DEV --server=$OC_LOGIN_SERVER_DEV

0 comments on commit e3963f0

Please sign in to comment.