Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hotswap from login, and use crcd for now #44

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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