diff options
| author | Jeffrey Zhang <jeffrey.zhang@99cloud.net> | 2016-02-16 22:17:22 +0800 |
|---|---|---|
| committer | Éric Lemoine <elemoine@mirantis.com> | 2016-02-18 09:06:44 +0100 |
| commit | 29833132d8f1df678f1e9ad7348e27311e3f5a3c (patch) | |
| tree | 872c93c15cff62ba9fbc8d3753a616979f8a3762 /tools/cleanup-containers | |
| parent | c32aa11256f6195e4193d2fedda4394f8a32b0be (diff) | |
| download | kolla-ansible-29833132d8f1df678f1e9ad7348e27311e3f5a3c.tar.gz kolla-ansible-29833132d8f1df678f1e9ad7348e27311e3f5a3c.zip | |
Also remove the volumes when cleaning up containers
TrivialFix
Change-Id: Ia52451d2c0de09ee9dcf79211389a3b1ce4ae738
Diffstat (limited to 'tools/cleanup-containers')
| -rwxr-xr-x | tools/cleanup-containers | 18 |
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!" |
