From 907635550a9529be8e543bcb0410f4c6d0024b46 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Wed, 13 Nov 2024 15:19:01 +0100 Subject: [PATCH] Fix retrying for req avail checks --- tests/btp/hack/Makefile | 4 +++- tests/btp/hack/registry-availibility-check.sh | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/btp/hack/Makefile b/tests/btp/hack/Makefile index d53a3f2..4ca5745 100644 --- a/tests/btp/hack/Makefile +++ b/tests/btp/hack/Makefile @@ -17,13 +17,15 @@ enable_docker_registry: @while ! kubectl get gateway kyma-gateway -n kyma-system --kubeconfig ${KUBECONFIG}; do echo "Waiting for kyma-gateway..."; sleep 1; done @echo "Enabling docker registry" @kubectl apply -f ${OPERATOR_MANIFEST} --kubeconfig ${KUBECONFIG} + @while ! kubectl get crd dockerregistries.operator.kyma-project.io --kubeconfig ${KUBECONFIG}; do echo "Waiting for docker-registry CRD..."; sleep 1; done + @kubectl wait --for condition=established crd/dockerregistries.operator.kyma-project.io --kubeconfig ${KUBECONFIG} @kubectl apply -f ../k8s-resources/dependencies/exposed-docker-registry-with-btp-storage.yaml -n kyma-system --kubeconfig ${KUBECONFIG} @echo "..waiting for docker registry" @kubectl wait --for condition=Installed dockerregistries.operator.kyma-project.io/default -n kyma-system --timeout=300s --kubeconfig ${KUBECONFIG} @echo "Docker registry installed" @while ! kubectl get secret dockerregistry-config-external --kubeconfig ${KUBECONFIG}; do echo "Waiting for dockerregistry-config-external secret..."; sleep 1; done @echo "Waiting for docker registry external address availibility" - ./registry-availibility-check.sh ${KUBECONFIG} + @for i in 1 2 3 4 5; do ./registry-availibility-check.sh ${KUBECONFIG} && break || sleep 5; done .PHONY: docker_registry_login docker_registry_login: diff --git a/tests/btp/hack/registry-availibility-check.sh b/tests/btp/hack/registry-availibility-check.sh index 2a2a0fe..a1cfed6 100755 --- a/tests/btp/hack/registry-availibility-check.sh +++ b/tests/btp/hack/registry-availibility-check.sh @@ -1,5 +1,4 @@ #!/bin/sh -set -e -o pipefail USERNAME=$(kubectl get secrets -n kyma-system dockerregistry-config-external -o jsonpath={.data.username} --kubeconfig ${KUBECONFIG} | base64 -d) PASSWORD=$(kubectl get secrets -n kyma-system dockerregistry-config-external -o jsonpath={.data.password} --kubeconfig ${KUBECONFIG} | base64 -d)