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>
This commit is contained in:
Giuseppe Scrivano 2019-10-02 17:07:07 +02:00
parent 257a985f5a
commit 4ad2cd54a1
No known key found for this signature in database
GPG key ID: E4730F97F60286ED

View file

@ -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")
}