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 <yroblamo@redhat.com>
Change-Id: I176682c2206075c221ab8d3e634a11cfc4c539d0
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