aboutsummaryrefslogtreecommitdiff
path: root/tools/cleanup-containers
diff options
context:
space:
mode:
authorJorge Niedbalski <jorge.niedbalski@linaro.org>2018-05-07 16:23:02 -0300
committerJorge Niedbalski <jorge.niedbalski@linaro.org>2018-05-07 16:23:02 -0300
commit6c5a6c65f11008b484551267e24ee04e73280232 (patch)
treec706e3dc1f5020761f6986c945d318f7d1d9e513 /tools/cleanup-containers
parentd67a2d288dd41fe558ff48083aa310745086aee6 (diff)
downloadkolla-ansible-6c5a6c65f11008b484551267e24ee04e73280232.tar.gz
kolla-ansible-6c5a6c65f11008b484551267e24ee04e73280232.zip
Enforce removal of container network namespace.
This patch enforces the removal of the container network namespace when the environment is destroyed. Closes-Bug: #1769651 Change-Id: I9b0bbbb5a59e6067a745635c555051ef97b79f9a Signed-off-by: Jorge Niedbalski <jorge.niedbalski@linaro.org>
Diffstat (limited to 'tools/cleanup-containers')
-rwxr-xr-xtools/cleanup-containers5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/cleanup-containers b/tools/cleanup-containers
index 62aa34af7..a9eec1130 100755
--- a/tools/cleanup-containers
+++ b/tools/cleanup-containers
@@ -35,6 +35,11 @@ echo "Stopping containers..."
echo "Removing containers..."
(docker rm -v -f ${containers_to_kill} 2>&1) > /dev/null
+echo "Disconnecting containers from docker host network"
+for container in ${containers_to_kill}; do
+(docker network disconnect -f host $container 2>&1) > /dev/null
+done
+
echo "Removing volumes..."
(docker volume rm ${volumes_to_remove} 2>&1) > /dev/null