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 --- cmd/podman/common/create.go | 3 +-- cmd/podman/common/create_opts.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'cmd/podman/common') diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index afaa1942e..8a3f02036 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -348,8 +348,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions, ) oomScoreAdjFlagName := "oom-score-adj" - createFlags.IntVar( - &cf.OOMScoreAdj, + createFlags.Int( oomScoreAdjFlagName, 0, "Tune the host's OOM preferences (-1000 to 1000)", ) diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index e5a2a0da3..ad6b3870a 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -286,7 +286,7 @@ func ContainerCreateToContainerCLIOpts(cc handlers.CreateContainerConfig, rtc *c LogDriver: cc.HostConfig.LogConfig.Type, LogOptions: stringMaptoArray(cc.HostConfig.LogConfig.Config), Name: cc.Name, - OOMScoreAdj: cc.HostConfig.OomScoreAdj, + OOMScoreAdj: &cc.HostConfig.OomScoreAdj, Arch: "", OS: "", Variant: "", -- cgit v1.2.3-54-g00ecf