1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #10058 from HuKeping/work

restart: Fix the compare of restart policy
This commit is contained in:
Alexander Morozov 2015-01-13 13:38:52 -08:00
commit 5862422a49

View file

@ -230,7 +230,7 @@ func (m *containerMonitor) shouldRestart(exitCode int) bool {
return true
case "on-failure":
// 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",
utils.TruncateID(m.container.ID), max)
return false