Kaynağa Gözat

Merge pull request #27387 from talex5/health-restart

Reset health status to starting when a container is restarted
Vincent Demeester 8 yıl önce
ebeveyn
işleme
7a4d286ddd
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      daemon/health.go

+ 4 - 1
daemon/health.go

@@ -251,7 +251,10 @@ func (d *Daemon) initHealthMonitor(c *container.Container) {
 	// This is needed in case we're auto-restarting
 	// This is needed in case we're auto-restarting
 	d.stopHealthchecks(c)
 	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 := &container.Health{}
 		h.Status = types.Starting
 		h.Status = types.Starting
 		c.State.Health = h
 		c.State.Health = h