From 555a15bcac9ff8b5b11594e16b471865d1abee82 Mon Sep 17 00:00:00 2001 From: Samuel Karp Date: Wed, 23 Oct 2024 11:40:12 -0700 Subject: [PATCH] generate: do not set OOMScoreAdj if no adjustment Existing OOMScoreAdj on the incoming spec should not be cleared. Fixes https://github.com/containerd/nri/issues/117 Signed-off-by: Samuel Karp --- pkg/runtime-tools/generate/generate.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/runtime-tools/generate/generate.go b/pkg/runtime-tools/generate/generate.go index 40ed98f..cd2bc28 100644 --- a/pkg/runtime-tools/generate/generate.go +++ b/pkg/runtime-tools/generate/generate.go @@ -329,9 +329,6 @@ func (g *Generator) AdjustCgroupsPath(path string) { func (g *Generator) AdjustOomScoreAdj(score *nri.OptionalInt) { if score != nil { g.SetProcessOOMScoreAdj(int(score.Value)) - } else { - g.SetProcessOOMScoreAdj(0) - g.Config.Process.OOMScoreAdj = nil } }