Skip to content

Commit e87c42a

Browse files
Merge pull request #8289 from derekhiggins/test-provisioned
OCPBUGS-32425: Test for the presence of "provisioned" server
2 parents 906d5d1 + 0b1867d commit e87c42a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

data/data/bootstrap/baremetal/files/usr/local/bin/master-bmh-update.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ until oc get baremetalhosts -n openshift-machine-api; do
1010
sleep 20
1111
done
1212

13-
while [ "$(oc get bmh -n openshift-machine-api -o name | wc -l)" -lt 1 ]; do
14-
echo "Waiting for bmh"
13+
N="0"
14+
while [ "$N" -eq "0" ] ; do
15+
echo "Waiting for control-plane bmh to appear..."
1516
sleep 20
17+
N=$(oc get bmh -n openshift-machine-api -l installer.openshift.io/role=control-plane --no-headers=true | wc -l)
1618
done
17-
18-
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
19-
echo "Waiting for masters to become provisioned"
20-
oc get bmh -A
19+
echo "Waiting for $N masters to become provisioned"
20+
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)" -lt "$N" ]; do
21+
echo "Waiting for $N masters to become provisioned"
22+
oc get bmh -A || true
2123
sleep 20
2224
done
2325

0 commit comments

Comments
 (0)