From 4ad2cd54a11e831a8e00560bc54e54a7bd534cf3 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 2 Oct 2019 17:07:07 +0200 Subject: 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 --- pkg/spec/spec.go | 3 +++ 1 file changed, 3 insertions(+) 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") } -- cgit v1.2.3-54-g00ecf