From c5ce76e7127d732c88f8764713a769f16134a369 Mon Sep 17 00:00:00 2001 From: inosato Date: Sat, 30 Jul 2022 21:13:19 +0900 Subject: [PATCH] Remove ioutil from component-helpers Signed-off-by: inosato --- .../src/k8s.io/component-helpers/node/util/sysctl/sysctl.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/staging/src/k8s.io/component-helpers/node/util/sysctl/sysctl.go b/staging/src/k8s.io/component-helpers/node/util/sysctl/sysctl.go index 311212c1faf..4910aa22d35 100644 --- a/staging/src/k8s.io/component-helpers/node/util/sysctl/sysctl.go +++ b/staging/src/k8s.io/component-helpers/node/util/sysctl/sysctl.go @@ -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) }