Skip to content

Commit

Permalink
Test for the presence of "provisioned" server
Browse files Browse the repository at this point in the history
rather the the absense of lines with "provisioned".
If the oc command fails the test will still evaluate to False.

Also mask failures from the second "oc get bmh" command so they
wont cause the script to exit.
  • Loading branch information
derekhiggins committed Apr 18, 2024
1 parent 4f77b17 commit 933957b
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -15,9 +15,13 @@ while [ "$(oc get bmh -n openshift-machine-api -o name | wc -l)" -lt 1 ]; do
sleep 20
done

while [ "$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane -o json | jq '.items[].status.provisioning.state' | grep -v provisioned -c)" -gt 0 ]; do
N="0"
while [ "$N" -eq "0" ] ; do
N=$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane --no-headers=true | wc -l)
done
while [ "$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane -o json | jq '.items[].status.provisioning.state' | grep provisioned -c)" -ne "$N" ]; do
echo "Waiting for masters to become provisioned"
oc get bmh -A
oc get bmh -A || true
sleep 20
done

Expand Down

0 comments on commit 933957b

Please sign in to comment.