2022-04-08 08:22:01 +00:00
|
|
|
#! /bin/bash
|
2024-02-14 18:41:50 +00:00
|
|
|
set -euo pipefail
|
2022-04-08 08:22:01 +00:00
|
|
|
|
2023-09-19 17:46:37 +00:00
|
|
|
NAMESPACE=${1:-default}
|
|
|
|
|
2022-04-12 09:19:24 +00:00
|
|
|
max_retries=500
|
2022-04-08 08:22:01 +00:00
|
|
|
c=0
|
2023-09-19 17:46:37 +00:00
|
|
|
while [[ $(kubectl -n $NAMESPACE get keycloaks/example-kc -o jsonpath="{.status.conditions[?(@.type == 'Ready')].status}") != "True" ]]
|
2022-04-08 08:22:01 +00:00
|
|
|
do
|
2024-02-14 18:41:50 +00:00
|
|
|
echo "$(date +"%T") Waiting for Keycloak example-kc status"
|
2022-04-08 08:22:01 +00:00
|
|
|
((c++)) && ((c==max_retries)) && exit -1
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
c=0
|
2023-09-19 17:46:37 +00:00
|
|
|
while [[ $(kubectl -n $NAMESPACE get keycloakrealmimports/example-count0-kc -o jsonpath="{.status.conditions[?(@.type == 'Done')].status}") != "True" ]]
|
2022-04-08 08:22:01 +00:00
|
|
|
do
|
2024-02-14 18:41:50 +00:00
|
|
|
echo "$(date +"%T") Waiting for Keycloak Realm Import example-count0-kc status"
|
2022-04-08 08:22:01 +00:00
|
|
|
((c++)) && ((c==max_retries)) && exit -1
|
|
|
|
sleep 1
|
|
|
|
done
|