From e909e7fa8a0cd33328b6642c566926ac4e470390 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 17 Oct 2020 16:33:38 +0200 Subject: [PATCH] outposts: kill container on down --- passbook/outposts/controllers/docker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/passbook/outposts/controllers/docker.py b/passbook/outposts/controllers/docker.py index b72a6e681..a47e1a7ae 100644 --- a/passbook/outposts/controllers/docker.py +++ b/passbook/outposts/controllers/docker.py @@ -98,7 +98,9 @@ class DockerController(BaseController): if has_been_created: # Since we've just created the container, give it some time to start. # If its still not up by then, restart it - self.logger.info("Container is unhealthy and new, giving it time to boot.") + self.logger.info( + "Container is unhealthy and new, giving it time to boot." + ) sleep(60) self.logger.info("Container is unhealthy, restarting...") container.restart() @@ -116,6 +118,7 @@ class DockerController(BaseController): try: container, _ = self._get_container() container.kill() + container.remove(force=True) except DockerException as exc: raise ControllerException from exc