mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #88510 from steveazz/steveazz/68026-rlimit
Fix golint issues for `pkg/util/rlimit`
This commit is contained in:
commit
1df63e7dc7
@ -1112,7 +1112,7 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie
|
|||||||
}
|
}
|
||||||
podCfg := kubeDeps.PodConfig
|
podCfg := kubeDeps.PodConfig
|
||||||
|
|
||||||
if err := rlimit.RlimitNumFiles(uint64(kubeServer.MaxOpenFiles)); err != nil {
|
if err := rlimit.SetNumFiles(uint64(kubeServer.MaxOpenFiles)); err != nil {
|
||||||
klog.Errorf("Failed to set rlimit on max file handles: %v", err)
|
klog.Errorf("Failed to set rlimit on max file handles: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,6 @@ pkg/util/labels # See previous effort in PR #80685
|
|||||||
pkg/util/oom
|
pkg/util/oom
|
||||||
pkg/util/procfs
|
pkg/util/procfs
|
||||||
pkg/util/removeall
|
pkg/util/removeall
|
||||||
pkg/util/rlimit
|
|
||||||
pkg/util/selinux
|
pkg/util/selinux
|
||||||
pkg/util/taints
|
pkg/util/taints
|
||||||
pkg/volume
|
pkg/volume
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RlimitNumFiles(maxOpenFiles uint64) error {
|
// SetNumFiles sets the linux rlimit for the maximum open files.
|
||||||
|
func SetNumFiles(maxOpenFiles uint64) error {
|
||||||
return unix.Setrlimit(unix.RLIMIT_NOFILE, &unix.Rlimit{Max: maxOpenFiles, Cur: maxOpenFiles})
|
return unix.Setrlimit(unix.RLIMIT_NOFILE, &unix.Rlimit{Max: maxOpenFiles, Cur: maxOpenFiles})
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RlimitNumFiles(maxOpenFiles uint64) error {
|
// SetNumFiles sets the rlimit for the maximum open files.
|
||||||
|
func SetNumFiles(maxOpenFiles uint64) error {
|
||||||
return errors.New("SetRLimit unsupported in this platform")
|
return errors.New("SetRLimit unsupported in this platform")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user