summaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-24 11:56:19 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-24 12:56:21 +0200
commit2e6a62fc380976b06fc9a57892b4070528b94b60 (patch)
tree514cc7968c6e46b77519676bb0e368751bb9d815 /cmd/podman/common
parent9f8d002e1f9630207314c18b2048d6333619191f (diff)
downloadpodman-2e6a62fc380976b06fc9a57892b4070528b94b60.tar.gz
podman-2e6a62fc380976b06fc9a57892b4070528b94b60.tar.bz2
podman-2e6a62fc380976b06fc9a57892b4070528b94b60.zip
podman: fix --cgroups=disabled
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-rw-r--r--cmd/podman/common/specgen.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go
index b90030f7f..fda11c0af 100644
--- a/cmd/podman/common/specgen.go
+++ b/cmd/podman/common/specgen.go
@@ -119,13 +119,13 @@ func getIOLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) (
func getPidsLimits(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string) (*specs.LinuxPids, error) {
pids := &specs.LinuxPids{}
hasLimits := false
+ if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
+ return nil, nil
+ }
if c.PIDsLimit > 0 {
pids.Limit = c.PIDsLimit
hasLimits = true
}
- if c.CGroupsMode == "disabled" && c.PIDsLimit > 0 {
- s.ResourceLimits.Pids.Limit = -1
- }
if !hasLimits {
return nil, nil
}