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

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 лет назад
Родитель
Сommit
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
 	}
 
+	if config.OomKillDisable != nil {
+		memory.DisableOOMKiller = config.OomKillDisable
+	}
+
 	if config.KernelMemory != 0 {
 		memory.Kernel = &config.KernelMemory
 	}