From: Yolanda Robla Date: Fri, 10 Jul 2020 09:55:11 +0000 (+0200) Subject: Do not stop loop on error X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=91d71c929645d6a5b91a9f9961ccf0a41a0c5fbc;p=kni%2Finstaller.git Do not stop loop on error It can be the case that the oc get nodes api is returning EOF, which is causing an error and is breaking the loop befor time. Change the way we capture the nodes, by allowing failure, then compute the ready nodes. Signed-off-by: Yolanda Robla Change-Id: I176682c2206075c221ab8d3e634a11cfc4c539d0 --- diff --git a/ci/kni_deploy_baremetal.sh b/ci/kni_deploy_baremetal.sh index fbdd8d3..71b482f 100755 --- a/ci/kni_deploy_baremetal.sh +++ b/ci/kni_deploy_baremetal.sh @@ -41,7 +41,8 @@ sleep 20m NUM_READY=0 while [[ "$NUM_READY" -lt 1 ]]; do - NUM_READY=$(KUBECONFIG=$HOME/.kni/$SITE_NAME/baremetal_automation/ocp/auth/kubeconfig $HOME/.kni/$SITE_NAME/requirements/oc get nodes | grep " Ready " | wc -l ) + READY_NODES=$(KUBECONFIG=$HOME/.kni/$SITE_NAME/baremetal_automation/ocp/auth/kubeconfig $HOME/.kni/$SITE_NAME/requirements/oc get nodes) + NUM_READY=$(echo $READY_NODES | grep " Ready " | wc -l ) sleep 1m done popd