diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-24 11:56:19 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2020-04-24 12:56:21 +0200 |
commit | 2e6a62fc380976b06fc9a57892b4070528b94b60 (patch) | |
tree | 514cc7968c6e46b77519676bb0e368751bb9d815 | |
parent | 9f8d002e1f9630207314c18b2048d6333619191f (diff) | |
download | podman-2e6a62fc380976b06fc9a57892b4070528b94b60.tar.gz podman-2e6a62fc380976b06fc9a57892b4070528b94b60.tar.bz2 podman-2e6a62fc380976b06fc9a57892b4070528b94b60.zip |
podman: fix --cgroups=disabled
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | cmd/podman/common/specgen.go | 6 | ||||
-rw-r--r-- | test/e2e/run_test.go | 1 |
2 files changed, 3 insertions, 4 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 } diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index df97ddf69..92db37096 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -937,7 +937,6 @@ USER mail` }) It("podman run with cgroups=disabled runs without cgroups", func() { - Skip(v2fail) SkipIfRemote() SkipIfRootless() // Only works on crun |