diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-10-02 17:07:07 +0200 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-10-02 17:07:14 +0200 |
commit | 4ad2cd54a11e831a8e00560bc54e54a7bd534cf3 (patch) | |
tree | 05b11881507e08f68b11384cf787864152096e74 /pkg/spec | |
parent | 257a985f5a7cff8f01891529ea89b0ea2800d61f (diff) | |
download | podman-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>
Diffstat (limited to 'pkg/spec')
-rw-r--r-- | pkg/spec/spec.go | 3 |
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") } |