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 cm
import (
"errors"
"io/ioutil"
"os"
"path"
"testing"
@@ -148,11 +147,11 @@ func TestSoftRequirementsValidationSuccess(t *testing.T) {
t.Skip("skipping cgroup v1 test on a cgroup v2 system")
}
req := require.New(t)
tempDir, err := ioutil.TempDir("", "")
tempDir, err := os.MkdirTemp("", "")
req.NoError(err)
defer os.RemoveAll(tempDir)
req.NoError(ioutil.WriteFile(path.Join(tempDir, "cpu.cfs_period_us"), []byte("0"), os.ModePerm))
req.NoError(ioutil.WriteFile(path.Join(tempDir, "cpu.cfs_quota_us"), []byte("0"), os.ModePerm))
req.NoError(os.WriteFile(path.Join(tempDir, "cpu.cfs_period_us"), []byte("0"), os.ModePerm))
req.NoError(os.WriteFile(path.Join(tempDir, "cpu.cfs_quota_us"), []byte("0"), os.ModePerm))
mountInt := mount.NewFakeMounter(
[]mount.MountPoint{
{