Skip to content

Commit 4936cd4

Browse files
author
Steve Azzopardi
committed
Fix golint issues for pkg/util/rlimit
pkg/util/rlimit/rlimit_linux.go:25:1: exported function RlimitNumFiles should have comment or be unexported pkg/util/rlimit/rlimit_linux.go:25:6: func name will be used as rlimit.RlimitNumFiles by other packages, and that stutters; consider calling this NumFiles pkg/util/rlimit/rlimit_unsupported.go:25:1: exported function RlimitNumFiles should have comment or be unexported pkg/util/rlimit/rlimit_unsupported.go:25:6: func name will be used as rlimit.RlimitNumFiles by other packages, and that stutters; consider calling this NumFiles Ref: kubernetes#68026
1 parent 105c0c6 commit 4936cd4

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

cmd/kubelet/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie
11121112
}
11131113
podCfg := kubeDeps.PodConfig
11141114

1115-
if err := rlimit.RlimitNumFiles(uint64(kubeServer.MaxOpenFiles)); err != nil {
1115+
if err := rlimit.SetNumFiles(uint64(kubeServer.MaxOpenFiles)); err != nil {
11161116
klog.Errorf("Failed to set rlimit on max file handles: %v", err)
11171117
}
11181118

hack/.golint_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ pkg/util/labels # See previous effort in PR #80685
193193
pkg/util/oom
194194
pkg/util/procfs
195195
pkg/util/removeall
196-
pkg/util/rlimit
197196
pkg/util/selinux
198197
pkg/util/taints
199198
pkg/volume

pkg/util/rlimit/rlimit_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"golang.org/x/sys/unix"
2323
)
2424

25-
func RlimitNumFiles(maxOpenFiles uint64) error {
25+
// SetNumFiles sets the linux rlimit for the maximum open files.
26+
func SetNumFiles(maxOpenFiles uint64) error {
2627
return unix.Setrlimit(unix.RLIMIT_NOFILE, &unix.Rlimit{Max: maxOpenFiles, Cur: maxOpenFiles})
2728
}

pkg/util/rlimit/rlimit_unsupported.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"errors"
2323
)
2424

25-
func RlimitNumFiles(maxOpenFiles uint64) error {
25+
// SetNumFiles sets the rlimit for the maximum open files.
26+
func SetNumFiles(maxOpenFiles uint64) error {
2627
return errors.New("SetRLimit unsupported in this platform")
2728
}

0 commit comments

Comments
 (0)