UNCLASSIFIED

Commit bda496ed authored by Brendon Lloyd's avatar Brendon Lloyd
Browse files

Add script to wait for mattermost custom resources to come up

parent ba16bc3e
Pipeline #456545 passed with stages
in 3 minutes and 22 seconds
#!/bin/bash
wait_project() {
# interval and timeout are in seconds
interval=5
timeout=600
#
resourcename=mattermost
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
if kubectl get $resourcename -o json --namespace=$resourcename -o jsonpath='{.items[0].status.state}' | \
grep "^stable" 1>/dev/null
then
echo "$resourcename custom resource creation finished"
break
fi
sleep $interval
let counter++
if [[ $(($counter * $interval)) -ge $timeout ]]; then
echo "$resourcename timeout waiting $timeout seconds for resource creation" 1>&2
exit 1
fi
done
set -e
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment