From 39932511c134938233e8bfe4796cec9a1b30d11e Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Sat, 11 Apr 2015 16:37:28 +0800 Subject: [PATCH] use hostConfig in verifyDaemonSettings We have moved resource configs to hostConfig. Signed-off-by: Qiang Huang --- daemon/container.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index 46defe9683..016ee1fdd1 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -1282,13 +1282,13 @@ func (container *Container) initializeNetworking() error { // Make sure the config is compatible with the current kernel func (container *Container) verifyDaemonSettings() { - if container.Config.Memory > 0 && !container.daemon.sysInfo.MemoryLimit { + if container.hostConfig.Memory > 0 && !container.daemon.sysInfo.MemoryLimit { logrus.Warnf("Your kernel does not support memory limit capabilities. Limitation discarded.") - container.Config.Memory = 0 + container.hostConfig.Memory = 0 } - if container.Config.Memory > 0 && !container.daemon.sysInfo.SwapLimit { + if container.hostConfig.Memory > 0 && !container.daemon.sysInfo.SwapLimit { logrus.Warnf("Your kernel does not support swap limit capabilities. Limitation discarded.") - container.Config.MemorySwap = -1 + container.hostConfig.MemorySwap = -1 } if container.daemon.sysInfo.IPv4ForwardingDisabled { logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")