Skip to content

Commit

Permalink
improve logging for wait func
Browse files Browse the repository at this point in the history
  • Loading branch information
friedrichwilken committed Oct 6, 2023
1 parent a01e736 commit ed91fea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hack/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 5 additions & 1 deletion hack/ci/check-k8s-resource-is-ready.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit ed91fea

Please sign in to comment.