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"
@@ -483,15 +482,16 @@ func (c *Config) Ulimits() []string {
483
482
// PidsLimit returns the default maximum number of pids to use in containers
484
483
func (c * Config ) PidsLimit () int64 {
485
484
if unshare .IsRootless () {
486
- if c .Engine .CgroupManager = = SystemdCgroupsManager {
487
- cgroup2 , _ := cgroupv2 . Enabled ()
488
- if cgroup2 {
489
- return c . Containers . PidsLimit
490
- }
485
+ if c .Engine .CgroupManager ! = SystemdCgroupsManager {
486
+ return 0
487
+ }
488
+ cgroup2 , _ := cgroupv2 . Enabled ()
489
+ if ! cgroup2 {
491
490
return 0
492
491
}
493
492
}
494
- return sysinfo .GetDefaultPidsLimit ()
493
+
494
+ return c .Containers .PidsLimit
495
495
}
496
496
497
497
// DetachKeys returns the default detach keys to detach from a container
You can’t perform that action at this time.
0 commit comments