aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2022-04-04 13:14:35 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2022-04-04 15:40:12 +0200
commit164b64ea3baa8502a23fc0c7674f4a7e60507aa0 (patch)
tree88e060255b3869822171c1eb200f3afaf1740ebd /pkg
parentd1f3a2d6a82ed66d4dab5be62821bc59bfb84dd8 (diff)
downloadpodman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.tar.gz
podman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.tar.bz2
podman-164b64ea3baa8502a23fc0c7674f4a7e60507aa0.zip
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 <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/entities/pods.go2
-rw-r--r--pkg/specgenutil/specgen.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index da93d3f8b..8406ca019 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -210,7 +210,7 @@ type ContainerCreateOptions struct {
Name string `json:"container_name"`
NoHealthCheck bool
OOMKillDisable bool
- OOMScoreAdj int
+ OOMScoreAdj *int
Arch string
OS string
Variant string
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, ":")