File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import (
11
11
12
12
"github.com/containers/common/pkg/apparmor"
13
13
"github.com/containers/common/pkg/cgroupv2"
14
- "github.com/containers/common/pkg/sysinfo"
15
14
"github.com/containers/storage"
16
15
"github.com/containers/storage/pkg/unshare"
17
16
"github.com/opencontainers/selinux/go-selinux"
@@ -484,15 +483,16 @@ func (c *Config) Ulimits() []string {
484
483
// PidsLimit returns the default maximum number of pids to use in containers
485
484
func (c * Config ) PidsLimit () int64 {
486
485
if unshare .IsRootless () {
487
- if c .Engine .CgroupManager = = SystemdCgroupsManager {
488
- cgroup2 , _ := cgroupv2 . Enabled ()
489
- if cgroup2 {
490
- return c . Containers . PidsLimit
491
- }
486
+ if c .Engine .CgroupManager ! = SystemdCgroupsManager {
487
+ return 0
488
+ }
489
+ cgroup2 , _ := cgroupv2 . Enabled ()
490
+ if ! cgroup2 {
492
491
return 0
493
492
}
494
493
}
495
- return sysinfo .GetDefaultPidsLimit ()
494
+
495
+ return c .Containers .PidsLimit
496
496
}
497
497
498
498
// DetachKeys returns the default detach keys to detach from a container
You can’t perform that action at this time.
0 commit comments