浏览代码

Daemon: passdown the `--oom-kill-disable` option to containerd

Current implementaion of docke daemon doesn't pass down the
`--oom-kill-disable` option specified by the end user to the containerd
when spawning a new docker instance with help from `runc` component, which
results in the `--oom-kill-disable` doesn't work no matter the flag is `true`
or `false`.

This PR will fix this issue reported by #36090

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Dennis Chen 7 年之前
父节点
当前提交
44b074d199
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      daemon/daemon_unix.go

+ 4 - 0
daemon/daemon_unix.go

@@ -103,6 +103,10 @@ func getMemoryResources(config containertypes.Resources) *specs.LinuxMemory {
 		memory.Swappiness = &swappiness
 		memory.Swappiness = &swappiness
 	}
 	}
 
 
+	if config.OomKillDisable != nil {
+		memory.DisableOOMKiller = config.OomKillDisable
+	}
+
 	if config.KernelMemory != 0 {
 	if config.KernelMemory != 0 {
 		memory.Kernel = &config.KernelMemory
 		memory.Kernel = &config.KernelMemory
 	}
 	}