From bf9fe25242d8a5f8dd02b23cf8c71b0650bc9999 Mon Sep 17 00:00:00 2001 From: Jianguo Ma Date: Mon, 8 Jan 2024 11:15:20 +0800 Subject: [PATCH 1/2] install oc from aro cluster Signed-off-by: Jianguo Ma --- src/main/scripts/install.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/scripts/install.sh b/src/main/scripts/install.sh index b39a467..61fa97f 100644 --- a/src/main/scripts/install.sh +++ b/src/main/scripts/install.sh @@ -258,18 +258,21 @@ apk update apk add gettext apk add apache2-utils -# Install the OpenShift CLI -wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz -q -P ~ -mkdir ~/openshift -tar -zxvf ~/openshift-client-linux.tar.gz -C ~/openshift -echo 'export PATH=$PATH:~/openshift' >> ~/.bash_profile && source ~/.bash_profile - -# Sign in to cluster +# Retrieve cluster credentials and api/console URLs credentials=$(az aro list-credentials -g $clusterRGName -n $clusterName -o json) kubeadminUsername=$(echo $credentials | jq -r '.kubeadminUsername') kubeadminPassword=$(echo $credentials | jq -r '.kubeadminPassword') apiServerUrl=$(az aro show -g $clusterRGName -n $clusterName --query 'apiserverProfile.url' -o tsv) consoleUrl=$(az aro show -g $clusterRGName -n $clusterName --query 'consoleProfile.url' -o tsv) + +# Install the OpenShift CLI +downloadUrl=$(echo $consoleUrl | sed -e "s/https:\/\/console/https:\/\/downloads/g") +wget ${downloadUrl}amd64/linux/oc.tar -q -P ~ +mkdir ~/openshift +tar xvf ~/oc.tar -C ~/openshift +echo 'export PATH=$PATH:~/openshift' >> ~/.bash_profile && source ~/.bash_profile + +# Sign in to cluster wait_login_complete $kubeadminUsername $kubeadminPassword "$apiServerUrl" $logFile if [[ $? -ne 0 ]]; then echo "Failed to sign into the cluster with ${kubeadminUsername}." >&2 From 37c64745f3d902acd64636d991b45e72174c5ed5 Mon Sep 17 00:00:00 2001 From: Jianguo Ma Date: Mon, 8 Jan 2024 13:56:00 +0800 Subject: [PATCH 2/2] bump version Signed-off-by: Jianguo Ma --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8ff8532..c3ca8d0 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ com.ibm.websphere.azure azure.liberty.aro - 1.0.50 + 1.0.51 com.microsoft.azure.iaas