mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Remove ioutil from component-helpers
Signed-off-by: inosato <si17_21@yahoo.co.jp>
This commit is contained in:
parent
3902a53419
commit
c5ce76e712
@ -17,7 +17,7 @@ limitations under the License.
|
||||
package sysctl
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -83,7 +83,7 @@ type procSysctl struct {
|
||||
|
||||
// GetSysctl returns the value for the specified sysctl setting
|
||||
func (*procSysctl) GetSysctl(sysctl string) (int, error) {
|
||||
data, err := ioutil.ReadFile(path.Join(sysctlBase, sysctl))
|
||||
data, err := os.ReadFile(path.Join(sysctlBase, sysctl))
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
@ -96,5 +96,5 @@ func (*procSysctl) GetSysctl(sysctl string) (int, error) {
|
||||
|
||||
// SetSysctl modifies the specified sysctl flag to the new value
|
||||
func (*procSysctl) SetSysctl(sysctl string, newVal int) error {
|
||||
return ioutil.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
|
||||
return os.WriteFile(path.Join(sysctlBase, sysctl), []byte(strconv.Itoa(newVal)), 0640)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user