Просмотр исходного кода

Log memory swap capabilities properly.

Check whether the swap limit capabilities are disabled or not only when memory swap is set to greater than 0.

Signed-off-by: David Calavera <david.calavera@gmail.com>
David Calavera 10 лет назад
Родитель
Сommit
7523beff41
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      daemon/container.go

+ 1 - 1
daemon/container.go

@@ -1286,7 +1286,7 @@ func (container *Container) verifyDaemonSettings() {
 		logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.")
 		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.")
 		container.hostConfig.MemorySwap = -1
 	}