@@ -21,7 +21,6 @@ import (
2121 "github.com/godbus/dbus/v5"
2222 "github.com/opencontainers/cgroups"
2323 "github.com/opencontainers/cgroups/fs2"
24- "github.com/sirupsen/logrus"
2524 "go.podman.io/storage/pkg/fileutils"
2625 "go.podman.io/storage/pkg/unshare"
2726 "golang.org/x/sys/unix"
@@ -52,7 +51,6 @@ type controller struct {
5251
5352type controllerHandler interface {
5453 Apply (* CgroupControl , * cgroups.Resources ) error
55- Destroy (* CgroupControl ) error
5654 Stat (* CgroupControl , * cgroups.Stats ) error
5755}
5856
@@ -150,23 +148,8 @@ func getCgroupPathForCurrentProcess() (string, error) {
150148 return cgroupPath , nil
151149}
152150
153- // getCgroupv1Path is a helper function to get the cgroup v1 path.
154- func (c * CgroupControl ) getCgroupv1Path (name string ) string {
155- return filepath .Join (cgroupRoot , name , c .config .Path )
156- }
157-
158151// initialize initializes the specified hierarchy.
159152func (c * CgroupControl ) initialize () (err error ) {
160- createdSoFar := map [string ]controllerHandler {}
161- defer func () {
162- if err != nil {
163- for name , ctr := range createdSoFar {
164- if err := ctr .Destroy (c ); err != nil {
165- logrus .Warningf ("error cleaning up controller %s for %s" , name , c .config .Path )
166- }
167- }
168- }
169- }()
170153 if err := createCgroupv2Path (filepath .Join (cgroupRoot , c .config .Path )); err != nil {
171154 return fmt .Errorf ("creating cgroup path %s: %w" , c .config .Path , err )
172155 }
0 commit comments