Remove ioutil in kubelet and its tests

Signed-off-by: inosato <si17_21@yahoo.co.jp>
This commit is contained in:
inosato
2022-07-18 23:51:51 +09:00
parent f6e163fe27
commit 3b95d3b076
40 changed files with 222 additions and 253 deletions

View File

@@ -21,7 +21,6 @@ package kubelet
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
@@ -146,7 +145,7 @@ func TestCleanupOrphanedPodDirs(t *testing.T) {
if err := os.MkdirAll(volumePath, 0750); err != nil {
return err
}
return ioutil.WriteFile(filepath.Join(volumePath, "test.txt"), []byte("test1"), 0640)
return os.WriteFile(filepath.Join(volumePath, "test.txt"), []byte("test1"), 0640)
},
validateFunc: func(kubelet *Kubelet) error {
podDir := kubelet.getPodDir("pod1uid")
@@ -160,7 +159,7 @@ func TestCleanupOrphanedPodDirs(t *testing.T) {
if err := os.MkdirAll(subPath, 0750); err != nil {
return err
}
return ioutil.WriteFile(filepath.Join(subPath, "test.txt"), []byte("test1"), 0640)
return os.WriteFile(filepath.Join(subPath, "test.txt"), []byte("test1"), 0640)
},
validateFunc: func(kubelet *Kubelet) error {
podDir := kubelet.getPodDir("pod1uid")