kolla-kubernetes/tools/wait_for_pods_termination.sh
shenjibiao b7f249e630 Fix spell error: the 'Waitng' is lack of letter 'i'.
Change-Id: I161c7716337a588a895fd7a890f9e032889aa46f
2017-02-13 17:13:32 +08:00

17 lines
458 B
Bash
Executable File

#!/bin/bash -e
set +x
end=$(date +%s)
end=$((end + 300))
while true; do
kubectl get pods --namespace=$1 | grep Terminating > /dev/null && \
TERMINATING=True || TERMINATING=False
[ $TERMINATING == "False" ] && \
break || true
sleep 1
now=$(date +%s)
echo 'Waiting for pod to terminate: ' $now
[ $now -gt $end ] && echo containers failed to terminate. && \
kubectl get pods --namespace $1 && exit -1
done
set -x