From ad4741351f7d132f9f9005022a23d77fd33c64fc Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Fri, 14 Oct 2016 15:26:47 +0100 Subject: [PATCH] Reset health status to starting when a container is restarted Signed-off-by: Thomas Leonard Upstream-commit: b8793cff48fc4c1b702917ebc528ca0c60fb3397 Component: engine --- components/engine/daemon/health.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/engine/daemon/health.go b/components/engine/daemon/health.go index 66fe5e299a..b9d74e2690 100644 --- a/components/engine/daemon/health.go +++ b/components/engine/daemon/health.go @@ -251,7 +251,10 @@ func (d *Daemon) initHealthMonitor(c *container.Container) { // This is needed in case we're auto-restarting d.stopHealthchecks(c) - if c.State.Health == nil { + if h := c.State.Health; h != nil { + h.Status = types.Starting + h.FailingStreak = 0 + } else { h := &container.Health{} h.Status = types.Starting c.State.Health = h