Skip to content

Commit

Permalink
Fix oc command installation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lautou committed Dec 11, 2024
1 parent d899cd6 commit 88328d3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,20 @@ download_ocp-install(){
}

download_oc(){
if [[ ! "$OCP_VERSION" ]]; then
echo "OCP version missing. Please provide OCP version when running this command!"
exit 1
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
if [[ $(uname -p) == 'arm' ]]; then
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-install-mac-arm64.tar.gz
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-client-mac-arm64.tar.gz
else
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-install-mac.tar.gz
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-client-mac.tar.gz
fi
else
# Linix
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-install-linux.tar.gz
# Linux
DOWNLOAD_URL=https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${OCP_VERSION}/openshift-client-linux.tar.gz
fi
echo "Downloading OpenShift CLI: ${DOWNLOAD_URL}"

Expand Down

0 comments on commit 88328d3

Please sign in to comment.