Skip to content

Commit

Permalink
Merge pull request moby#19311 from estesp/no-oom-warning-when-cant-even
Browse files Browse the repository at this point in the history
Only warn on OOMKill disable if the feature is actually requested
  • Loading branch information
calavera committed Jan 13, 2016
2 parents 661d75f + 5a707d9 commit 9c30492
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions daemon/daemon_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,12 @@ func verifyContainerResources(resources *containertypes.Resources) ([]string, er
logrus.Warnf("You specified a kernel memory limit on a kernel older than 4.0. Kernel memory limits are experimental on older kernels, it won't work as expected and can cause your system to be unstable.")
}
if resources.OomKillDisable != nil && !sysInfo.OomKillDisable {
warnings = append(warnings, "Your kernel does not support OomKillDisable, OomKillDisable discarded.")
logrus.Warnf("Your kernel does not support OomKillDisable, OomKillDisable discarded.")
// only produce warnings if the setting wasn't to *disable* the OOM Kill; no point
// warning the caller if they already wanted the feature to be off
if *resources.OomKillDisable {
warnings = append(warnings, "Your kernel does not support OomKillDisable, OomKillDisable discarded.")
logrus.Warnf("Your kernel does not support OomKillDisable, OomKillDisable discarded.")
}
resources.OomKillDisable = nil
}

Expand Down

0 comments on commit 9c30492

Please sign in to comment.