@@ -23,9 +23,8 @@ import (
2323 "github.com/containers/storage/pkg/unshare"
2424 systemdDbus "github.com/coreos/go-systemd/v22/dbus"
2525 "github.com/godbus/dbus/v5"
26- "github.com/opencontainers/runc/libcontainer/cgroups"
27- "github.com/opencontainers/runc/libcontainer/cgroups/fs2"
28- "github.com/opencontainers/runc/libcontainer/configs"
26+ "github.com/opencontainers/cgroups"
27+ "github.com/opencontainers/cgroups/fs2"
2928 "github.com/sirupsen/logrus"
3029 "golang.org/x/sys/unix"
3130)
4544// CgroupControl controls a cgroup hierarchy
4645type CgroupControl struct {
4746 cgroup2 bool
48- config * configs .Cgroup
47+ config * cgroups .Cgroup
4948 systemd bool
5049 // List of additional cgroup subsystems joined that
5150 // do not have a custom handler.
@@ -59,7 +58,7 @@ type controller struct {
5958
6059type controllerHandler interface {
6160 Create (* CgroupControl ) (bool , error )
62- Apply (* CgroupControl , * configs .Resources ) error
61+ Apply (* CgroupControl , * cgroups .Resources ) error
6362 Destroy (* CgroupControl ) error
6463 Stat (* CgroupControl , * cgroups.Stats ) error
6564}
@@ -298,14 +297,14 @@ func readFileByKeyAsUint64(path, key string) (uint64, error) {
298297}
299298
300299// New creates a new cgroup control
301- func New (path string , resources * configs .Resources ) (* CgroupControl , error ) {
300+ func New (path string , resources * cgroups .Resources ) (* CgroupControl , error ) {
302301 cgroup2 , err := IsCgroup2UnifiedMode ()
303302 if err != nil {
304303 return nil , err
305304 }
306305 control := & CgroupControl {
307306 cgroup2 : cgroup2 ,
308- config : & configs .Cgroup {
307+ config : & cgroups .Cgroup {
309308 Path : path ,
310309 Resources : resources ,
311310 },
@@ -327,15 +326,15 @@ func New(path string, resources *configs.Resources) (*CgroupControl, error) {
327326}
328327
329328// NewSystemd creates a new cgroup control
330- func NewSystemd (path string , resources * configs .Resources ) (* CgroupControl , error ) {
329+ func NewSystemd (path string , resources * cgroups .Resources ) (* CgroupControl , error ) {
331330 cgroup2 , err := IsCgroup2UnifiedMode ()
332331 if err != nil {
333332 return nil , err
334333 }
335334 control := & CgroupControl {
336335 cgroup2 : cgroup2 ,
337336 systemd : true ,
338- config : & configs .Cgroup {
337+ config : & cgroups .Cgroup {
339338 Path : path ,
340339 Resources : resources ,
341340 Rootless : unshare .IsRootless (),
@@ -354,7 +353,7 @@ func Load(path string) (*CgroupControl, error) {
354353 control := & CgroupControl {
355354 cgroup2 : cgroup2 ,
356355 systemd : false ,
357- config : & configs .Cgroup {
356+ config : & cgroups .Cgroup {
358357 Path : path ,
359358 },
360359 }
@@ -486,7 +485,7 @@ func (c *CgroupControl) DeleteByPath(path string) error {
486485}
487486
488487// Update updates the cgroups
489- func (c * CgroupControl ) Update (resources * configs .Resources ) error {
488+ func (c * CgroupControl ) Update (resources * cgroups .Resources ) error {
490489 for _ , h := range handlers {
491490 if err := h .Apply (c , resources ); err != nil {
492491 return err
0 commit comments