mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
use hostConfig in verifyDaemonSettings
We have moved resource configs to hostConfig. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
parent
e3c1cc8d77
commit
39932511c1
1 changed files with 4 additions and 4 deletions
|
@ -1282,13 +1282,13 @@ func (container *Container) initializeNetworking() error {
|
||||||
|
|
||||||
// Make sure the config is compatible with the current kernel
|
// Make sure the config is compatible with the current kernel
|
||||||
func (container *Container) verifyDaemonSettings() {
|
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.")
|
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.")
|
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 {
|
if container.daemon.sysInfo.IPv4ForwardingDisabled {
|
||||||
logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
|
logrus.Warnf("IPv4 forwarding is disabled. Networking will not work")
|
||||||
|
|
Loading…
Add table
Reference in a new issue