outposts: don't restart container when health checks are starting

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-09-20 19:46:05 +02:00
parent 5a8b356dc7
commit 180d27cc37
1 changed files with 3 additions and 5 deletions

View File

@ -164,11 +164,9 @@ class DockerController(BaseController):
self.down() self.down()
return self.up(depth + 1) return self.up(depth + 1)
# Check that container is healthy # Check that container is healthy
if ( if container.status == "running" and container.attrs.get("State", {}).get(
container.status == "running" "Health", {}
and container.attrs.get("State", {}).get("Health", {}).get("Status", "") ).get("Status", "") not in ["healthy", "starting"]:
!= "healthy"
):
# At this point we know the config is correct, but the container isn't healthy, # At this point we know the config is correct, but the container isn't healthy,
# so we just restart it with the same config # so we just restart it with the same config
if has_been_created: if has_been_created: