From 730225876d3c39ed1a1b95ad315fd7666d03a726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Min=C3=A1=C5=99?= Date: Mon, 30 May 2016 09:18:11 +0200 Subject: [PATCH] hack/util: wait for registry readiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Waiting just for registry's endpoints isn't sufficient. It takes few more seconds for the registry to become ready. Let's wait until ready before launching tests. Signed-off-by: Michal Minář --- hack/util.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hack/util.sh b/hack/util.sh index bd5a55838a79..e8bb15dc7143 100644 --- a/hack/util.sh +++ b/hack/util.sh @@ -641,7 +641,9 @@ function install_registry { } function wait_for_registry { - wait_for_command '[[ "$(oc get endpoints docker-registry --output-version=v1 --template="{{ if .subsets }}{{ len .subsets }}{{ else }}0{{ end }}" --config=${ADMIN_KUBECONFIG} || echo "0")" != "0" ]]' $((5*TIME_MIN)) + wait_for_command "oc get endpoints docker-registry --template='{{ len .subsets }}' --config='${ADMIN_KUBECONFIG}' | grep -q '[1-9][0-9]*'" $((5*TIME_MIN)) + local readyjs='{.items[*].status.conditions[?(@.type=="Ready")].status}' + wait_for_command "oc get pod -l deploymentconfig=docker-registry -o jsonpath='$readyjs' --config='${ADMIN_KUBECONFIG}' | grep -qi true" $TIME_MIN }