Skip to content

Commit 16bb0d3

Browse files
committed
Merge pull request #11729 from stepancheg:constant
PiperOrigin-RevId: 759785528
2 parents d30c58e + 1410b28 commit 16bb0d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runsc/cgroup/cgroup_v2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type cgroupV2 struct {
7878
}
7979

8080
func newCgroupV2(mountpoint, group string, useSystemd bool) (Cgroup, error) {
81-
data, err := os.ReadFile(filepath.Join(mountpoint, "cgroup.controllers"))
81+
data, err := os.ReadFile(filepath.Join(mountpoint, controllersFile))
8282
if err != nil {
8383
return nil, err
8484
}
@@ -436,7 +436,7 @@ func (*cpu2) set(spec *specs.LinuxResources, path string) error {
436436
}
437437

438438
v += " " + strconv.FormatUint(period, 10)
439-
if err := setValue(path, "cpu.max", v); err != nil {
439+
if err := setValue(path, cpuLimitCgroup, v); err != nil {
440440
return err
441441
}
442442
}
@@ -557,7 +557,7 @@ func (*memory2) set(spec *specs.LinuxResources, path string) error {
557557

558558
if spec.Memory.Limit != nil {
559559
if val := numToStr(*spec.Memory.Limit); val != "" {
560-
if err := setValue(path, "memory.max", val); err != nil {
560+
if err := setValue(path, memoryLimitCgroup, val); err != nil {
561561
return err
562562
}
563563
}

0 commit comments

Comments
 (0)