Merge pull request #12293 from hqhq/hq_use_hostconfig
use hostConfig in verifyDaemonSettings Upstream-commit: a8e095b243355454d7f8269ad267f2d581fd52ac Component: engine
This commit is contained in:
@ -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")
|
||||
|
||||
Reference in New Issue
Block a user