Make cleanup remove restarting/exited containers
If we have bug in contianer or it simplt somehow ended up in Exited state, cleanup doesn't flush it. It also means it doesn't flush volumes and that might cause an dirty env. Closes-Bug: #1587344 Change-Id: Ib5705992500ce7efdc66509df61c381bd33d1954
This commit is contained in:
parent
e6c1d41782
commit
f76e9a1e0d
@ -10,7 +10,7 @@ if [ -n "$1" ]; then
|
||||
containers_to_kill=($(docker ps | grep -E "$1" | awk '{print $1}'))
|
||||
volumes_to_remove=($(docker volume ls | grep -E "$1" | awk '{print $1}'))
|
||||
else
|
||||
containers_to_kill=$(docker ps --filter "label=kolla_version" --format "{{.Names}}")
|
||||
containers_to_kill=$(docker ps --filter "label=kolla_version" --format "{{.Names}}" -a)
|
||||
|
||||
volumes_to_remove=$(docker inspect -f '{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}' ${containers_to_kill} | \
|
||||
egrep -v '(^\s*$)' | sort | uniq)
|
||||
|
Loading…
Reference in New Issue
Block a user