Skip to content

Commit

Permalink
Merge pull request #1262 from retroflexer/bz1770273-crictl-error-in-s…
Browse files Browse the repository at this point in the history
…top-all-containers

Bug 1770273: Verify all containers are dead in stop_all_containers() function
  • Loading branch information
openshift-merge-robot committed Nov 20, 2019
2 parents 5795bb4 + 35db287 commit 2e560b2
Showing 1 changed file with 14 additions and 2 deletions.
Expand Up @@ -337,8 +337,20 @@ contents:
}
stop_all_containers() {
echo "Stopping all containers.."
crictl ps -q | xargs -r crictl stop
conids=$(crictl ps -q)
iterations=0
while [ ! -z "$conids" ]; do
let iterations=$iterations+1
if [ $iterations -ge 60 ]; then
echo "Failed to stop all containers after 60 iterations. Exiting!"
exit 1
fi
crictl stop $conids || true
echo "Waiting for all containers to stop... ($iterations/60)"
sleep 5
conids=$(crictl ps -q)
done
echo "All containers are stopped."
}
# validate_environment performs the same actions as the discovery container in etcd-member init
Expand Down

0 comments on commit 2e560b2

Please sign in to comment.