From 14fe39968f986696b385b942fa4248e1b5c42384 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 20 May 2019 21:44:16 +0200 Subject: 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 --- pkg/spec/spec.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg') 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. -- cgit v1.2.3-54-g00ecf