From 164b64ea3baa8502a23fc0c7674f4a7e60507aa0 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 4 Apr 2022 13:14:35 +0200 Subject: specgen: do not set OOMScoreAdj by default do not force a value of OOMScoreAdj=0 if it is wasn't specified by the user. Closes: https://github.com/containers/podman/issues/13731 Signed-off-by: Giuseppe Scrivano --- pkg/specgenutil/specgen.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/specgenutil') diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 186d3862b..7d4fca846 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -753,8 +753,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions s.PreserveFDs = c.PreserveFDs } - if s.OOMScoreAdj == nil || c.OOMScoreAdj != 0 { - s.OOMScoreAdj = &c.OOMScoreAdj + if s.OOMScoreAdj == nil || c.OOMScoreAdj != nil { + s.OOMScoreAdj = c.OOMScoreAdj } if c.Restart != "" { splitRestart := strings.Split(c.Restart, ":") -- cgit v1.2.3-54-g00ecf