Remove ioutil in kubelet and its tests
Signed-off-by: inosato <si17_21@yahoo.co.jp>
This commit is contained in:
@@ -21,7 +21,6 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net"
|
||||
"os"
|
||||
@@ -204,7 +203,7 @@ func testPipe(t *testing.T, label string) {
|
||||
}
|
||||
|
||||
func testRegularFile(t *testing.T, label string, exists bool) {
|
||||
f, err := ioutil.TempFile("", "test-file")
|
||||
f, err := os.CreateTemp("", "test-file")
|
||||
require.NoErrorf(t, err, "Failed to create file for test purposes: %v while setting up: %s", err, label)
|
||||
testFile := f.Name()
|
||||
if !exists {
|
||||
@@ -218,7 +217,7 @@ func testRegularFile(t *testing.T, label string, exists bool) {
|
||||
}
|
||||
|
||||
func testUnixDomainSocket(t *testing.T, label string) {
|
||||
f, err := ioutil.TempFile("", "test-domain-socket")
|
||||
f, err := os.CreateTemp("", "test-domain-socket")
|
||||
require.NoErrorf(t, err, "Failed to create file for test purposes: %v while setting up: %s", err, label)
|
||||
testFile := f.Name()
|
||||
f.Close()
|
||||
@@ -241,7 +240,7 @@ func testPendingUnixDomainSocket(t *testing.T, label string) {
|
||||
// not-yet-ready state. We need this because the Kubelet keeps an eye on file
|
||||
// changes and acts on them, leading to potential race issues as described in
|
||||
// the referenced issue above
|
||||
f, err := ioutil.TempFile("", "test-domain-socket")
|
||||
f, err := os.CreateTemp("", "test-domain-socket")
|
||||
require.NoErrorf(t, err, "Failed to create file for test purposes: %v while setting up: %s", err, label)
|
||||
testFile := f.Name()
|
||||
f.Close()
|
||||
|
Reference in New Issue
Block a user