outposts: kill container on down

This commit is contained in:
Jens Langhammer 2020-10-17 16:33:38 +02:00
parent bee38551f3
commit e909e7fa8a

View file

@ -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