From 30534f979b9fab26c2bc20f0d156bfd4fd01c872 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 25 Feb 2016 12:01:18 -0800 Subject: [PATCH] Fix setting OomScoreAdj from OCI spec Signed-off-by: Tonis Tiigi --- spec.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec.go b/spec.go index 70ccdd81..af7ef657 100644 --- a/spec.go +++ b/spec.go @@ -304,6 +304,9 @@ func createLibcontainerConfig(cgroupName string, spec *specs.LinuxSpec) (*config config.ProcessLabel = spec.Linux.SelinuxProcessLabel config.AppArmorProfile = spec.Linux.ApparmorProfile config.NoNewPrivileges = spec.Linux.NoNewPrivileges + if oomScoreAdj := spec.Linux.Resources.OOMScoreAdj; oomScoreAdj != nil { + config.OomScoreAdj = *oomScoreAdj + } for _, g := range spec.Process.User.AdditionalGids { config.AdditionalGroups = append(config.AdditionalGroups, strconv.FormatUint(uint64(g), 10)) }