11#! /usr/bin/env bash
22set -xeo pipefail
33
4- OCP_VERSION=${OCP_VERSION:- 4.18 }
4+ OCP_VERSION=${OCP_VERSION:- 4.20.3 }
55OCP_RELEASE_TYPE=${OCP_RELEASE_TYPE:- stable}
66cluster_name=${CLUSTER_NAME:- ocp-virt}
77domain_name=lab
88
99api_ip=${API_IP:- 192.168.123.253}
1010virtual_router_id=${VIRTUAL_ROUTER_ID:- 253}
1111registry=" default-route-openshift-image-registry.apps.${cluster_name} .${domain_name} "
12- HOME=" /root"
1312
1413NUM_OF_WORKERS=${NUM_OF_WORKERS:- 3}
1514total_number_of_nodes=$(( 1 + NUM_OF_WORKERS))
@@ -43,6 +42,7 @@ kcli delete network $cluster_name -y
4342function cleanup {
4443 kcli delete cluster $cluster_name -y
4544 kcli delete network $cluster_name -y
45+ sudo rm -f /etc/containers/registries.conf.d/003-${cluster_name} .conf
4646}
4747
4848if [ -z $SKIP_DELETE ]; then
@@ -67,7 +67,7 @@ ctlplanes: 1
6767workers: $NUM_OF_WORKERS
6868machine: q35
6969network_type: OVNKubernetes
70- pull_secret: /root /openshift_pull.json
70+ pull_secret: $HOME /openshift_pull.json
7171vmrules:
7272 - $cluster_name -worker-.*:
7373 nets:
@@ -136,7 +136,7 @@ controller_ip=`kubectl get node -o wide | grep ctlp | awk '{print $6}'`
136136
137137if [ ` cat /etc/hosts | grep ${api_ip} | grep " default-route-openshift-image-registry.apps.${cluster_name} .${domain_name} " | wc -l` == 0 ]; then
138138 echo " adding registry to hosts"
139- sed -i " s/${api_ip} /${api_ip} default-route-openshift-image-registry.apps.${cluster_name} .${domain_name} /g" /etc/hosts
139+ sudo sed -i " s/${api_ip} /${api_ip} default-route-openshift-image-registry.apps.${cluster_name} .${domain_name} /g" /etc/hosts
140140fi
141141
142142
0 commit comments