From 91d71c929645d6a5b91a9f9961ccf0a41a0c5fbc Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 10 Jul 2020 11:55:11 +0200 Subject: [PATCH] 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 --- ci/kni_deploy_baremetal.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.16.6