Skip to content

Commit

Permalink
Fix warden status check (kyma-project#299)
Browse files Browse the repository at this point in the history
* Fix warden status check

* format
  • Loading branch information
halamix2 authored Oct 16, 2024
1 parent df3d15e commit c1e9026
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions hack/verify_warden_status.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash

function get_kyma_status () {
local number=1
while [[ $number -le 100 ]] ; do
echo ">--> checking warden deployment status #$number"
local STATUS=$(kubectl get deployment warden-operator -n kyma-system -o jsonpath='{.status.conditions[0].status}')
echo "warden ready: ${STATUS:='UNKNOWN'}"
[[ "$STATUS" == "True" ]] && return 0
sleep 5
((number = number + 1))
done

get_all_and_fail() {
kubectl get all --all-namespaces
exit 1
}

get_kyma_status
echo "waiting for deployment"
kubectl wait -n kyma-system --for=condition=Available --timeout=1m deployment warden-operator || get_all_and_fail

echo "waiting for operator"
kubectl wait -n kyma-system --for=condition=Ready --timeout=1m pod --selector "app.kubernetes.io/component"="warden-operator" || get_all_and_fail

echo "waiting for admission"
kubectl wait -n kyma-system --for=condition=Ready --timeout=1m pod --selector "app.kubernetes.io/component"="warden-admission" || get_all_and_fail

0 comments on commit c1e9026

Please sign in to comment.