aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-18 15:03:23 +0000
committerGerrit Code Review <review@openstack.org>2016-02-18 15:03:23 +0000
commit4c6907f7fc2ff6301152afe6a4dc09e85b1d815d (patch)
treeb21d77b5fc4354407cd2d93d81fc0a84c547ce8d
parent78562697f2136edfcaec345274bf09eb64644c6d (diff)
parent29833132d8f1df678f1e9ad7348e27311e3f5a3c (diff)
downloadkolla-4c6907f7fc2ff6301152afe6a4dc09e85b1d815d.tar.gz
kolla-4c6907f7fc2ff6301152afe6a4dc09e85b1d815d.zip
Merge "Also remove the volumes when cleaning up containers"
-rwxr-xr-xtools/cleanup-containers18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/cleanup-containers b/tools/cleanup-containers
index 962a61251..cb3b2a733 100755
--- a/tools/cleanup-containers
+++ b/tools/cleanup-containers
@@ -8,6 +8,7 @@ fi
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=(
bootstrap_{ceph_mon,cinder,glance,heat,ironic,ironic_pxe,keystone,magnum,mistral,mongodb,murano,neutron,nova,nova_compute} \
@@ -35,6 +36,20 @@ else
)
ceph_osd_bootstrap=$(docker ps -a --filter "name=bootstrap_osd_*" --format "{{.Names}}")
containers_to_kill="${containers_to_kill} ${ceph_osd_bootstrap}"
+
+ volumes_to_remove=(
+ glance \
+ ironic-pxe \
+ mariadb \
+ openvswitch_db \
+ neutron_metadata_socket \
+ nova_{compute,libvirt} \
+ ceph_mon{,_config} \
+ rabbitmq \
+ mongodb \
+ rsyslog{,_socket} \
+ haproxy_socket
+ )
fi
echo "Stopping containers..."
@@ -43,4 +58,7 @@ echo "Stopping containers..."
echo "Removing containers..."
(docker rm -v -f ${containers_to_kill[@]} 2>&1) > /dev/null
+echo "Removing volumes..."
+(docker volume rm ${volumes_to_remove[@]} 2>&1) > /dev/null
+
echo "All cleaned up!"