mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: allow to run rootless containers on cgroupV2
Before cl/402392291 and cl/402614820, it worked without any problem. In this case, we just ignore a cgroup configuration. We do the same thing, when we don't have permissions to create new cgroups on cgroupV1. PiperOrigin-RevId: 402913129
This commit is contained in:
@@ -1278,7 +1278,10 @@ func (c *Container) setupCgroupForSubcontainer(conf *config.Config, spec *specs.
|
||||
// no cgroups was configured.
|
||||
func cgroupInstall(conf *config.Config, cg *cgroup.Cgroup, res *specs.LinuxResources) (*cgroup.Cgroup, error) {
|
||||
// TODO(gvisor.dev/issue/3481): Remove when cgroups v2 is supported.
|
||||
if !conf.Rootless && cgroup.IsOnlyV2() {
|
||||
if cgroup.IsOnlyV2() {
|
||||
if conf.Rootless {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, fmt.Errorf("cgroups V2 is not yet supported. Enable cgroups V1 and retry")
|
||||
}
|
||||
if err := cg.Install(res); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user