summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-10-02 17:07:07 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-10-02 17:07:14 +0200
commit4ad2cd54a11e831a8e00560bc54e54a7bd534cf3 (patch)
tree05b11881507e08f68b11384cf787864152096e74
parent257a985f5a7cff8f01891529ea89b0ea2800d61f (diff)
downloadpodman-4ad2cd54a11e831a8e00560bc54e54a7bd534cf3.tar.gz
podman-4ad2cd54a11e831a8e00560bc54e54a7bd534cf3.tar.bz2
podman-4ad2cd54a11e831a8e00560bc54e54a7bd534cf3.zip
rootless: allow cgroupfs manager on cgroups v2
if there are no resources specified, make sure the OCI resources block is empty so that the OCI runtime won't complain. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--pkg/spec/spec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index 38f9c7306..c7aa003e8 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -387,6 +387,9 @@ func (config *CreateConfig) createConfigToOCISpec(runtime *libpod.Runtime, userM
if err != nil {
return nil, err
}
+ if !addedResources {
+ configSpec.Linux.Resources = &spec.LinuxResources{}
+ }
if addedResources && !cgroup2 {
return nil, errors.New("invalid configuration, cannot set resources with rootless containers not using cgroups v2 unified mode")
}