libct/cg: simplify getting cgroup manager

1. Make Rootless and Systemd flags part of config.Cgroups.

2. Make all cgroup managers (not just fs2) return error (so it can do
   more initialization -- added by the following commits).

3. Replace complicated cgroup manager instantiation in factory_linux
   by a single (and simple) libcontainer/cgroups/manager.New() function.

4. getUnifiedPath is simplified to check that only a single path is
   supplied (rather than checking that other paths, if supplied,
   are the same).

[v2: can't -> cannot]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-08-07 12:22:16 -07:00
parent 147ad561e8
commit 097c6d7425
17 changed files with 188 additions and 222 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ func testCheckpoint(t *testing.T, userns bool) {
}
config := newTemplateConfig(t, &tParam{userns: userns})
factory, err := libcontainer.New(t.TempDir(), libcontainer.Cgroupfs)
factory, err := libcontainer.New(t.TempDir())
ok(t, err)
container, err := factory.Create("test", config)