Skip to content

Commit 85c7c99

Browse files
committed
libct/cg/fs2: fix some revive linter warnings
These: > Error: libcontainer/cgroups/fs2/cpu.go:15:6: var-naming: func isCpuSet should be isCPUSet (revive) > func isCpuSet(r *cgroups.Resources) bool { > ^ > Error: libcontainer/cgroups/fs2/cpu.go:19:6: var-naming: func setCpu should be setCPU (revive) > func setCpu(dirPath string, r *cgroups.Resources) error { > ^ They are going to be shown after next commits because of linter-extra CI job (which, due to major changes, now thinks it's a new code so extra linters apply). Fixing it beforehand. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 986451c commit 85c7c99

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

libcontainer/cgroups/fs2/cpu.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ import (
1313
"github.com/opencontainers/runc/libcontainer/configs"
1414
)
1515

16-
func isCpuSet(r *configs.Resources) bool {
16+
func isCPUSet(r *configs.Resources) bool {
1717
return r.CpuWeight != 0 || r.CpuQuota != 0 || r.CpuPeriod != 0 || r.CPUIdle != nil || r.CpuBurst != nil
1818
}
1919

20-
func setCpu(dirPath string, r *configs.Resources) error {
21-
if !isCpuSet(r) {
20+
func setCPU(dirPath string, r *configs.Resources) error {
21+
if !isCPUSet(r) {
2222
return nil
2323
}
2424

libcontainer/cgroups/fs2/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func needAnyControllers(r *configs.Resources) (bool, error) {
4848
if isIoSet(r) && have("io") {
4949
return true, nil
5050
}
51-
if isCpuSet(r) && have("cpu") {
51+
if isCPUSet(r) && have("cpu") {
5252
return true, nil
5353
}
5454
if isCpusetSet(r) && have("cpuset") {
@@ -65,7 +65,7 @@ func needAnyControllers(r *configs.Resources) (bool, error) {
6565
// Refer to: http://man7.org/linux/man-pages/man7/cgroups.7.html
6666
// As at Linux 4.19, the following controllers are threaded: cpu, perf_event, and pids.
6767
func containsDomainController(r *configs.Resources) bool {
68-
return isMemorySet(r) || isIoSet(r) || isCpuSet(r) || isHugeTlbSet(r)
68+
return isMemorySet(r) || isIoSet(r) || isCPUSet(r) || isHugeTlbSet(r)
6969
}
7070

7171
// CreateCgroupPath creates cgroupv2 path, enabling all the supported controllers.

libcontainer/cgroups/fs2/fs2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (m *Manager) Set(r *configs.Resources) error {
182182
return err
183183
}
184184
// cpu (since kernel 4.15)
185-
if err := setCpu(m.dirPath, r); err != nil {
185+
if err := setCPU(m.dirPath, r); err != nil {
186186
return err
187187
}
188188
// devices (since kernel 4.15, pseudo-controller)

0 commit comments

Comments
 (0)