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

Merge pull request #12287 from calavera/check_memory_swap_when_disabled

Log memory swap capabilities properly.
This commit is contained in:
Michael Crosby 2015-04-13 13:19:52 -07:00
commit 3d424ead3b

View file

@ -1286,7 +1286,7 @@ func (container *Container) verifyDaemonSettings() {
logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.") logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
container.hostConfig.Memory = 0 container.hostConfig.Memory = 0
} }
if container.hostConfig.Memory > 0 && !container.daemon.sysInfo.SwapLimit { if container.hostConfig.Memory > 0 && container.hostConfig.MemorySwap != -1 && !container.daemon.sysInfo.SwapLimit {
logrus.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.") logrus.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.")
container.hostConfig.MemorySwap = -1 container.hostConfig.MemorySwap = -1
} }