Skip to content

Commit 673928a

Browse files
authored
Use a fixed version of IBM Cloud CLI for e2e tests (#937)
1 parent b03d09c commit 673928a

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ bin/
66
cmd/clusterctl/clusterctl
77
cmd/manager/manager
88
pvsadm
9+
IBM_Cloud_CLI*
910

1011
# command generated files
1112
kubeconfig

scripts/ci-e2e.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21-
# With the recent ibmcloud have seen panic and need this environment set to avoid this panic, for more information
22-
# refer the Notes section in https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/tag/v2.11.0.
23-
export LANG=en_US.UTF-8
24-
2521
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2622
cd "${REPO_ROOT}" || exit 1
2723
GOPATH_BIN="$(go env GOPATH)/bin/"
@@ -38,28 +34,44 @@ ARTIFACTS="${ARTIFACTS:-${PWD}/_artifacts}"
3834
mkdir -p "${ARTIFACTS}/logs/"
3935

4036
ARCH=$(uname -m)
37+
OS=$(uname -s)
38+
IBMCLOUD_CLI_VERSION=${IBMCLOUD_CLI_VERSION:-"2.12.0"}
4139
PVSADM_VERSION=${PVSADM_VERSION:-"v0.1.7"}
4240
E2E_FLAVOR=${E2E_FLAVOR:-}
4341
REGION=${REGION:-"us-south"}
4442

43+
[ "${ARCH}" == "x86_64" ] && ARCH="amd64"
44+
4545
trap cleanup EXIT
4646

4747
cleanup(){
4848
# stop the boskos heartbeat
4949
[[ -z ${HEART_BEAT_PID:-} ]] || kill -9 "${HEART_BEAT_PID}" || true
5050
}
5151

52+
# Installing binaries from github releases
5253
install_pvsadm(){
53-
[ "${ARCH}" == "x86_64" ] && ARCH="amd64"
54+
platform="$(echo ${OS} | tr '[:upper:]' '[:lower:]')-${ARCH}"
5455

55-
# Installing binaries from github releases
56-
curl -fsL https://github.com/ppc64le-cloud/pvsadm/releases/download/${PVSADM_VERSION}/pvsadm-linux-${ARCH} -o pvsadm
56+
curl -fsL https://github.com/ppc64le-cloud/pvsadm/releases/download/${PVSADM_VERSION}/pvsadm-${platform} -o pvsadm
5757
chmod +x ./pvsadm
5858
}
5959

60+
install_ibmcloud_cli(){
61+
if [ ${OS} == "Linux" ]; then
62+
platform="linux-${ARCH}"
63+
elif [ ${OS} == "Darwin" ]; then
64+
platform="macos"
65+
fi
66+
67+
curl https://download.clis.cloud.ibm.com/ibm-cloud-cli/${IBMCLOUD_CLI_VERSION}/binaries/IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION}_${platform}.tgz -o IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION}_${platform}.tgz
68+
tar -xf IBM_Cloud_CLI_${IBMCLOUD_CLI_VERSION}_${platform}.tgz
69+
install IBM_Cloud_CLI/ibmcloud /usr/local/bin
70+
71+
}
72+
6073
create_powervs_network_instance(){
61-
# Install ibmcloud CLI tool
62-
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
74+
install_ibmcloud_cli
6375

6476
# Login to IBM Cloud using the API Key
6577
ibmcloud login -a cloud.ibm.com -r ${REGION}
@@ -93,7 +105,7 @@ prerequisites_powervs(){
93105
# Assigning PowerVS variables
94106
export IBMPOWERVS_SSHKEY_NAME=${IBMPOWERVS_SSHKEY_NAME:-"powercloud-bot-key"}
95107
export IBMPOWERVS_IMAGE_NAME=${IBMPOWERVS_IMAGE_NAME:-"capibm-powervs-centos-streams8-1-24-2"}
96-
export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:-"0f28d13a-6e33-4d86-b6d7-a9b46ff7659e"}
108+
export IBMPOWERVS_SERVICE_INSTANCE_ID=${BOSKOS_RESOURCE_ID:-"d53da3bf-1f4a-42fa-9735-acf16b1a05cd"}
97109
export IBMPOWERVS_NETWORK_NAME="capi-net-$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head --bytes 5)"
98110
# Setting controller loglevel to allow debug logs from the PowerVS client
99111
export LOGLEVEL=5

0 commit comments

Comments
 (0)