aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-08-23 09:42:47 -0400
committerGitHub <noreply@github.com>2022-08-23 09:42:47 -0400
commit5948320951e17a60da848ba16e3c7aed1676129a (patch)
tree6cdfaef577783527a6fae0b123a465156064f000 /pkg/specgen/generate
parent833501a9a15562865d4ab8887a58250f7f4fe14a (diff)
parent64339d47c105373557248d45fddf7ab2db435180 (diff)
downloadpodman-5948320951e17a60da848ba16e3c7aed1676129a.tar.gz
podman-5948320951e17a60da848ba16e3c7aed1676129a.tar.bz2
podman-5948320951e17a60da848ba16e3c7aed1676129a.zip
Merge pull request #15384 from sstosh/options-cgroupsv1-rootless
Warning messages are printed and ignored if we use an unsupported option on cgroups V1 rootless systems
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/validate.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/specgen/generate/validate.go b/pkg/specgen/generate/validate.go
index 9c933d747..3c5d5fb96 100644
--- a/pkg/specgen/generate/validate.go
+++ b/pkg/specgen/generate/validate.go
@@ -9,6 +9,7 @@ import (
"github.com/containers/common/pkg/cgroups"
"github.com/containers/common/pkg/sysinfo"
+ "github.com/containers/podman/v4/pkg/rootless"
"github.com/containers/podman/v4/pkg/specgen"
"github.com/containers/podman/v4/utils"
)
@@ -19,6 +20,11 @@ func verifyContainerResourcesCgroupV1(s *specgen.SpecGenerator) ([]string, error
sysInfo := sysinfo.New(true)
+ if s.ResourceLimits != nil && rootless.IsRootless() {
+ s.ResourceLimits = nil
+ warnings = append(warnings, "Resource limits are not supported and ignored on cgroups V1 rootless systems")
+ }
+
if s.ResourceLimits == nil {
return warnings, nil
}