diff --git a/integration/container_update_resources_test.go b/integration/container_update_resources_test.go index 5067b54d2..b7af4d869 100644 --- a/integration/container_update_resources_test.go +++ b/integration/container_update_resources_test.go @@ -21,7 +21,6 @@ package integration import ( "bytes" - "io/ioutil" "os" "strings" "testing" @@ -116,7 +115,7 @@ func getCgroupMemoryLimitForTask(t *testing.T, task containerd.Task) uint64 { func isSwapLikelyEnabled() bool { // Check whether swap is enabled. swapFile := "/proc/swaps" - swapData, err := ioutil.ReadFile(swapFile) + swapData, err := os.ReadFile(swapFile) if err != nil { // We can't read the file or it doesn't exist, assume we don't have swap. return false diff --git a/integration/volume_copy_up_test.go b/integration/volume_copy_up_test.go index 664f4de35..1e0e20730 100644 --- a/integration/volume_copy_up_test.go +++ b/integration/volume_copy_up_test.go @@ -18,7 +18,6 @@ package integration import ( "fmt" - "io/ioutil" "os" "path/filepath" goruntime "runtime" @@ -76,7 +75,7 @@ func TestVolumeCopyUp(t *testing.T) { assert.Equal(t, len(volumePaths), 1, "expected exactly 1 volume") testFilePath := filepath.Join(volumePaths[0], "test_file") - contents, err := ioutil.ReadFile(testFilePath) + contents, err := os.ReadFile(testFilePath) require.NoError(t, err) assert.Equal(t, "test_content\n", string(contents)) @@ -89,7 +88,7 @@ func TestVolumeCopyUp(t *testing.T) { require.NoError(t, err) t.Logf("Check whether host path of the volume is updated") - contents, err = ioutil.ReadFile(testFilePath) + contents, err = os.ReadFile(testFilePath) require.NoError(t, err) assert.Equal(t, "new_content\n", string(contents)) } @@ -159,7 +158,7 @@ func getHostPathForVolumes(criRoot, containerID string) ([]string, error) { return nil, err } - volumes, err := ioutil.ReadDir(hostPath) + volumes, err := os.ReadDir(hostPath) if err != nil { return nil, err } diff --git a/runtime/v2/runc/manager/manager_linux.go b/runtime/v2/runc/manager/manager_linux.go index 39e97e9f6..a8ac45bfc 100644 --- a/runtime/v2/runc/manager/manager_linux.go +++ b/runtime/v2/runc/manager/manager_linux.go @@ -20,7 +20,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "os" "path/filepath" goruntime "runtime" @@ -196,7 +196,7 @@ func (manager) Start(ctx context.Context, id string, opts shim.StartOpts) (_ str }() // make sure to wait after start go cmd.Wait() - if data, err := ioutil.ReadAll(os.Stdin); err == nil { + if data, err := io.ReadAll(os.Stdin); err == nil { if len(data) > 0 { var any ptypes.Any if err := proto.Unmarshal(data, &any); err != nil {