UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects

add wait job

Merged Alozie Obuh requested to merge add-wait-job into main
1 file
+ 2
0
Compare changes
  • Side-by-side
  • Inline
+ 2
0
@@ -8,6 +8,7 @@ counter=0
# need to remove the default "set -e" to allow commands to return nonzero exit codes without the script failing
set +e
while true; do
echo "checking $resourcename status..."
if kubectl get $resourcename --namespace=$resourcename -o jsonpath='{.items[0].status.state}' | \
grep "^stable" 1>/dev/null
then
@@ -15,6 +16,7 @@ while true; do
break
fi
sleep $interval
echo "waiting 5 seconds..."
let counter++
if [[ $(($counter * $interval)) -ge $timeout ]]; then
echo "$resourcename timeout waiting $timeout seconds for resource creation, running describe..." 1>&2
Loading