summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-05-20 21:44:16 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-05-20 21:45:05 +0200
commit14fe39968f986696b385b942fa4248e1b5c42384 (patch)
treefd990766448525715d8d081814a1f32a36e95a80 /pkg
parent9567d87bdf244de62f7c6763191dc7bf12e425cd (diff)
downloadpodman-14fe39968f986696b385b942fa4248e1b5c42384.tar.gz
podman-14fe39968f986696b385b942fa4248e1b5c42384.tar.bz2
podman-14fe39968f986696b385b942fa4248e1b5c42384.zip
rootless: force resources to be nil on cgroup v1
force the resources block to be empty instead of having default values. Regression introduced by 8e88461511e81d2327e4c1a1315bb58fda1827ca Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/spec/spec.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index df303db6d..0d953ff6f 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -357,6 +357,10 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
if addedResources && !cgroup2 {
return nil, errors.New("invalid configuration, cannot set resources with rootless containers not using cgroups v2 unified mode")
}
+ if !cgroup2 {
+ // Force the resources block to be empty instead of having default values.
+ configSpec.Linux.Resources = &spec.LinuxResources{}
+ }
}
// Make sure that the bind mounts keep options like nosuid, noexec, nodev.