1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

Simplified while loops

This commit is contained in:
Ewout Prangsma 2018-03-09 10:46:07 +01:00
parent 8614a1774e
commit 3c3dbd19da
No known key found for this signature in database
GPG key ID: 4DBAD380D93D0698
2 changed files with 22 additions and 12 deletions

View file

@ -51,16 +51,22 @@ echo "$config" | kubectl --namespace=$NS create -f - || exit 1
# Wait until custom resources are available
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found)
while [ -z $response ]; do
sleep 1
while :; do
response=$(kubectl get crd arangodeployments.database.arangodb.com --template="non-empty" --ignore-not-found)
echo -n .
done
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found)
while [ -z $response ]; do
if [ ! -z $response ]; then
break
fi
sleep 1
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found)
echo -n .
done
while :; do
response=$(kubectl get crd arangolocalstorages.storage.arangodb.com --template="non-empty" --ignore-not-found)
if [ ! -z $response ]; then
break
fi
sleep 1
echo -n .
done
echo "Arango Operator deployed"

View file

@ -10,8 +10,12 @@ if [ -z $NS ]; then
fi
kubectl delete namespace $NS --now --ignore-not-found
response=$(kubectl get namespace $NS --template="non-empty" --ignore-not-found)
while [ ! -z $response ]; do
sleep 1
response=$(kubectl get namespace $NS --template="non-empty" --ignore-not-found)
# Wait until its really gone
while :; do
response=$(kubectl get namespace $NS --template="non-empty" --ignore-not-found)
if [ -z $response ]; then
break
fi
sleep 0.5
done