outposts: kill container on down

This commit is contained in:
Jens Langhammer 2020-10-17 16:33:38 +02:00
parent bee38551f3
commit e909e7fa8a
1 changed files with 4 additions and 1 deletions

View File

@ -98,7 +98,9 @@ class DockerController(BaseController):
if has_been_created: if has_been_created:
# Since we've just created the container, give it some time to start. # Since we've just created the container, give it some time to start.
# If its still not up by then, restart it # 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) sleep(60)
self.logger.info("Container is unhealthy, restarting...") self.logger.info("Container is unhealthy, restarting...")
container.restart() container.restart()
@ -116,6 +118,7 @@ class DockerController(BaseController):
try: try:
container, _ = self._get_container() container, _ = self._get_container()
container.kill() container.kill()
container.remove(force=True)
except DockerException as exc: except DockerException as exc:
raise ControllerException from exc raise ControllerException from exc