ソースを参照

Merge pull request #10058 from HuKeping/work

restart: Fix the compare of restart policy
Alexander Morozov 10 年 前
コミット
5862422a49
1 ファイル変更1 行追加1 行削除
  1. 1 1
      daemon/monitor.go

+ 1 - 1
daemon/monitor.go

@@ -230,7 +230,7 @@ func (m *containerMonitor) shouldRestart(exitCode int) bool {
 		return true
 		return true
 	case "on-failure":
 	case "on-failure":
 		// the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count
 		// the default value of 0 for MaximumRetryCount means that we will not enforce a maximum count
-		if max := m.restartPolicy.MaximumRetryCount; max != 0 && m.failureCount >= max {
+		if max := m.restartPolicy.MaximumRetryCount; max != 0 && m.failureCount > max {
 			log.Debugf("stopping restart of container %s because maximum failure could of %d has been reached",
 			log.Debugf("stopping restart of container %s because maximum failure could of %d has been reached",
 				utils.TruncateID(m.container.ID), max)
 				utils.TruncateID(m.container.ID), max)
 			return false
 			return false