Skip to content

Commit ed9de2c

Browse files
committed
Remove Create method from controllerHandler
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 5552aa7 commit ed9de2c

File tree

5 files changed

+0
-30
lines changed

5 files changed

+0
-30
lines changed

common/pkg/cgroups/blkio_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ func (c *linuxBlkioHandler) Apply(ctr *CgroupControl, res *cgroups.Resources) er
2929
return man.Set(res)
3030
}
3131

32-
// Create the cgroup.
33-
func (c *linuxBlkioHandler) Create(ctr *CgroupControl) (bool, error) {
34-
return false, nil
35-
}
36-
3732
// Destroy the cgroup.
3833
func (c *linuxBlkioHandler) Destroy(ctr *CgroupControl) error {
3934
return rmDirRecursively(ctr.getCgroupv1Path(Blkio))

common/pkg/cgroups/cgroups_linux.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ type controller struct {
5151
}
5252

5353
type controllerHandler interface {
54-
Create(*CgroupControl) (bool, error)
5554
Apply(*CgroupControl, *cgroups.Resources) error
5655
Destroy(*CgroupControl) error
5756
Stat(*CgroupControl, *cgroups.Stats) error
@@ -171,15 +170,6 @@ func (c *CgroupControl) initialize() (err error) {
171170
if err := createCgroupv2Path(filepath.Join(cgroupRoot, c.config.Path)); err != nil {
172171
return fmt.Errorf("creating cgroup path %s: %w", c.config.Path, err)
173172
}
174-
for name, handler := range handlers {
175-
created, err := handler.Create(c)
176-
if err != nil {
177-
return err
178-
}
179-
if created {
180-
createdSoFar[name] = handler
181-
}
182-
}
183173
return nil
184174
}
185175

common/pkg/cgroups/cpu_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ func (c *linuxCPUHandler) Apply(ctr *CgroupControl, res *cgroups.Resources) erro
2828
return man.Set(res)
2929
}
3030

31-
// Create the cgroup.
32-
func (c *linuxCPUHandler) Create(ctr *CgroupControl) (bool, error) {
33-
return false, nil
34-
}
35-
3631
// Destroy the cgroup.
3732
func (c *linuxCPUHandler) Destroy(ctr *CgroupControl) error {
3833
return rmDirRecursively(ctr.getCgroupv1Path(CPU))

common/pkg/cgroups/memory_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ func (c *linuxMemHandler) Apply(ctr *CgroupControl, res *cgroups.Resources) erro
2727
return man.Set(res)
2828
}
2929

30-
// Create the cgroup.
31-
func (c *linuxMemHandler) Create(ctr *CgroupControl) (bool, error) {
32-
return false, nil
33-
}
34-
3530
// Destroy the cgroup.
3631
func (c *linuxMemHandler) Destroy(ctr *CgroupControl) error {
3732
return rmDirRecursively(ctr.getCgroupv1Path(Memory))

common/pkg/cgroups/pids_linux.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ func (c *linuxPidHandler) Apply(ctr *CgroupControl, res *cgroups.Resources) erro
2727
return man.Set(res)
2828
}
2929

30-
// Create the cgroup.
31-
func (c *linuxPidHandler) Create(ctr *CgroupControl) (bool, error) {
32-
return false, nil
33-
}
34-
3530
// Destroy the cgroup.
3631
func (c *linuxPidHandler) Destroy(ctr *CgroupControl) error {
3732
return rmDirRecursively(ctr.getCgroupv1Path(Pids))

0 commit comments

Comments
 (0)