diff --git a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-40.yaml b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-40.yaml index f89111ca41865..936815bc920b0 100644 --- a/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-40.yaml +++ b/ci-operator/templates/openshift/openshift-ansible/cluster-launch-e2e-40.yaml @@ -157,16 +157,17 @@ objects: break done - i=0 - MAX_RETRIES=10 - wait_expiry_ts="$(($(date +%s) + 90))" - until oc --request-timeout=80s rollout status "${ROUTER_DEPLOYMENT}" -n "${ROUTER_NAMESPACE}" -w; do - i=$((i+1)) - [ $i -eq $MAX_RETRIES ] && echo "timeout waiting for ${ROUTER_NAMESPACE}/${ROUTER_DEPLOYMENT} to be available" && exit 1 - echo "error ${ROUTER_NAMESPACE}/${ROUTER_DEPLOYMENT} did not come up" - sleep "$((wait_expiry_ts - $(date +%s)))" - wait_expiry_ts="$(($(date +%s) + 90))" + TARGET="$(date -d '10 minutes' +%s)" + NOW="$(date +%s)" + while [[ "${NOW}" -lt "${TARGET}" ]]; do + REMAINING="$((TARGET - NOW))" + if oc --request-timeout="${REMAINING}s" rollout status "${ROUTER_DEPLOYMENT}" -n "${ROUTER_NAMESPACE}" -w; then + break + fi + sleep 2 + NOW="$(date +%s)" done + [[ "${NOW}" -ge "${TARGET}" ]] && echo "timeout waiting for ${ROUTER_NAMESPACE}/${ROUTER_DEPLOYMENT} to be available" && exit 1 # set up cloud-provider-specific env vars if [[ "${CLUSTER_TYPE}" == "gcp" ]]; then