diff --git a/hack/ci/Makefile b/hack/ci/Makefile index 408f458f..f918f4e2 100644 --- a/hack/ci/Makefile +++ b/hack/ci/Makefile @@ -27,4 +27,4 @@ enable-nats-module: .PHONY: get-nats-via-lifecycle-manager get-nats-via-lifecycle-manager: install-lifecycle-manager install-latest-nats-module-template-fast enable-nats-module - ./check-k8s-resource-is-ready.sh + ./check-k8s-resource-is-ready.sh 180 nats kyma-system diff --git a/hack/ci/check-k8s-resource-is-ready.sh b/hack/ci/check-k8s-resource-is-ready.sh index cc410109..ccf81eb7 100755 --- a/hack/ci/check-k8s-resource-is-ready.sh +++ b/hack/ci/check-k8s-resource-is-ready.sh @@ -1,9 +1,13 @@ #!/bin/bash timeouttime=${1:-180} +resource=${2:-nats} +namespace=${3:-kyma-system} check-nats-ready() { - timeout ${timeouttime} bash -c 'while [[ "$(kubectl get -n kyma-system nats -ojsonpath='{.items[0].status.state}')" != "Ready" ]]; do sleep 1; done' + echo "checking ${resource} in the namespace ${namespace} to become 'Ready' for ${timeouttime} seconds" + + timeout ${timeouttime} bash -c 'while [[ "$(kubectl get -n ${namespace} ${resource} -ojsonpath='{.items[0].status.state}')" != "Ready" ]]; do sleep 1; done' if [[ $? -ne 0 ]]; then echo "NATS was not 'Ready' after ${timeouttime} seconds"