runsc: Ignore EROFS errors when setting up cgroups in --rootless mode.

This bypasses cgroup-related errors when running `runsc` in a container with
no permission to create its own cgroups.

PiperOrigin-RevId: 444652251
This commit is contained in:
Etienne Perot
2022-04-26 13:36:38 -07:00
committed by gVisor bot
parent 68f30cbc5e
commit b5a59f96c8
+1 -1
View File
@@ -1279,7 +1279,7 @@ func (c *Container) setupCgroupForSubcontainer(conf *config.Config, spec *specs.
func cgroupInstall(conf *config.Config, cg cgroup.Cgroup, res *specs.LinuxResources) (cgroup.Cgroup, error) {
if err := cg.Install(res); err != nil {
switch {
case errors.Is(err, unix.EACCES) && conf.Rootless:
case (errors.Is(err, unix.EACCES) || errors.Is(err, unix.EROFS)) && conf.Rootless:
log.Warningf("Skipping cgroup configuration in rootless mode: %v", err)
return nil, nil
default: