summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-11 16:45:46 +0200
committerGitHub <noreply@github.com>2019-10-11 16:45:46 +0200
commit9f1f4ef19e2d15ad453c6c3ac4e00e53bd36eb0d (patch)
treeb6ea2570c6d19668adb159c537adcbd74359666a /pkg
parent495db28c7537cbf05ef8c1416f7bea35e193404e (diff)
parent5036b6a9fb6c102dd5fcb6989d36ad91db8e1e2a (diff)
downloadpodman-9f1f4ef19e2d15ad453c6c3ac4e00e53bd36eb0d.tar.gz
podman-9f1f4ef19e2d15ad453c6c3ac4e00e53bd36eb0d.tar.bz2
podman-9f1f4ef19e2d15ad453c6c3ac4e00e53bd36eb0d.zip
Merge pull request #4235 from giuseppe/no-pids-cgroupfs
rootless: do not set PIDs limit if --cgroup-manager=cgroupfs
Diffstat (limited to 'pkg')
-rw-r--r--pkg/spec/spec.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index 57c6e8da7..8f00d3270 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -302,8 +302,8 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
// RESOURCES - PIDS
if config.Resources.PidsLimit > 0 {
- // if running on rootless on a cgroupv1 machine, pids limit is
- // not supported. If the value is still the default
+ // if running on rootless on a cgroupv1 machine or using the cgroupfs manager, pids
+ // limit is not supported. If the value is still the default
// then ignore the settings. If the caller asked for a
// non-default, then try to use it.
setPidLimit := true
@@ -312,7 +312,11 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
if err != nil {
return nil, err
}
- if !cgroup2 && config.Resources.PidsLimit == sysinfo.GetDefaultPidsLimit() {
+ runtimeConfig, err := runtime.GetConfig()
+ if err != nil {
+ return nil, err
+ }
+ if (!cgroup2 || runtimeConfig.CgroupManager != libpod.SystemdCgroupsManager) && config.Resources.PidsLimit == sysinfo.GetDefaultPidsLimit() {
setPidLimit = false
}
}