diff --git a/hack/run-e2e-conformance-virtual-ocp.sh b/hack/run-e2e-conformance-virtual-ocp.sh index 2f5f30fb96..6489adfff1 100755 --- a/hack/run-e2e-conformance-virtual-ocp.sh +++ b/hack/run-e2e-conformance-virtual-ocp.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -xeo pipefail -OCP_VERSION=${OCP_VERSION:-4.16.0-rc.1} +OCP_VERSION=${OCP_VERSION:-4.16.0-rc.2} cluster_name=${CLUSTER_NAME:-ocp-virt} domain_name=lab @@ -209,6 +209,24 @@ podman build -t "${SRIOV_NETWORK_WEBHOOK_IMAGE}" -f "${root}/Dockerfile.webhook" echo "## wait for registry to be available" kubectl wait configs.imageregistry.operator.openshift.io/cluster --for=condition=Available --timeout=120s +echo "## wait for the all cluster to be stable" +MAX_RETRIES=20 +DELAY_SECONDS=10 +retries=0 +until [ $retries -ge $MAX_RETRIES ]; do + if [ $(kubectl get clusteroperator --no-headers | awk '{print $3}' | grep False | wc -l) -eq 0 ]; then + break + fi + retries=$((retries+1)) + echo "cluster operators are not ready. Retrying... (Attempt $retries/$MAX_RETRIES)" + sleep $DELAY_SECONDS +done + +if [ $retries -eq $MAX_RETRIES ]; then + echo "Max retries reached. Exiting..." + exit 1 +fi + dockercgf=`kubectl -n ${NAMESPACE} get sa builder -oyaml | grep imagePullSecrets -A 1 | grep -o "builder-.*"` auth=`kubectl -n ${NAMESPACE} get secret ${dockercgf} -ojson | jq '.data.".dockercfg"'` auth="${auth:1:-1}" @@ -216,8 +234,9 @@ auth=`echo ${auth} | base64 -d` echo ${auth} > registry-login.conf internal_registry="image-registry.openshift-image-registry.svc:5000" -pass=$( jq .\"$internal_registry\".password registry-login.conf ) -podman login -u serviceaccount -p ${pass:1:-1} $registry --tls-verify=false +pass=$( jq .\"image-registry.openshift-image-registry.svc:5000\".auth registry-login.conf ) +pass=`echo ${pass:1:-1} | base64 -d` +podman login -u serviceaccount -p ${pass:15} $registry --tls-verify=false MAX_RETRIES=20 DELAY_SECONDS=10