Skip to content

Commit c4598f6

Browse files
authored
wait for registration-service route (#1240)
1 parent 8f4432e commit c4598f6

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

scripts/ci/manage-devsandbox-dashboard.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,22 @@ if [[ ${DEPLOY_UI} == "true" ]]; then
176176
# Get the HOST_NS (host operator namespace)
177177
HOST_NS=$(oc get projects -l app=host-operator --output=name -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | sort | tail -n 1)
178178

179+
# Wait for registration-service deployment and route to be ready
180+
oc wait --for=condition=Available deployment/registration-service -n ${HOST_NS} --timeout=5m
181+
# Wait for registration-service route to exist
182+
NEXT_WAIT_TIME=0
183+
while [[ -z $(oc get routes registration-service -n ${HOST_NS} -o jsonpath='{.status.ingress[0].host}' 2>/dev/null || true) ]]; do
184+
if [[ ${NEXT_WAIT_TIME} -eq 60 ]]; then
185+
echo ""
186+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: Timeout waiting for registration-service route"
187+
oc get routes -n ${HOST_NS}
188+
exit 1
189+
fi
190+
echo -n "."
191+
sleep 2
192+
((NEXT_WAIT_TIME++))
193+
done
194+
179195
# Get the Registration Service API URL
180196
REGISTRATION_SERVICE_API="https://$(oc get route registration-service -n ${HOST_NS} -o custom-columns=":spec.host" | tr -d '\n')/api/v1"
181197

0 commit comments

Comments
 (0)