From b5a59f96c8ece5ca47fed43b7fade4bd6d513777 Mon Sep 17 00:00:00 2001 From: Etienne Perot Date: Tue, 26 Apr 2022 13:33:59 -0700 Subject: [PATCH] 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 --- runsc/container/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runsc/container/container.go b/runsc/container/container.go index b7e96fce4..344335615 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -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: