diff --git a/pkg/clusterdiscovery/clusterapi/clusterapi.go b/pkg/clusterdiscovery/clusterapi/clusterapi.go index e4b1f0ffe1dd..304eb219f186 100644 --- a/pkg/clusterdiscovery/clusterapi/clusterapi.go +++ b/pkg/clusterdiscovery/clusterapi/clusterapi.go @@ -3,7 +3,7 @@ package clusterapi import ( "context" "fmt" - "io/ioutil" + "os" "time" corev1 "k8s.io/api/core/v1" @@ -200,7 +200,7 @@ func (d *ClusterDetector) unJoinClusterAPICluster(clusterName string) error { func generateKubeconfigFile(clusterName string, kubeconfigData []byte) (string, error) { kubeconfigPath := fmt.Sprintf("/etc/%s.kubeconfig", clusterName) - err := ioutil.WriteFile(kubeconfigPath, kubeconfigData, 0600) + err := os.WriteFile(kubeconfigPath, kubeconfigData, 0600) if err != nil { klog.Errorf("Failed to write File %s: %v", kubeconfigPath, err) return "", err diff --git a/test/e2e/suite_test.go b/test/e2e/suite_test.go index a7337e79a66e..0625f62c2047 100644 --- a/test/e2e/suite_test.go +++ b/test/e2e/suite_test.go @@ -3,7 +3,7 @@ package e2e import ( "context" "fmt" - "io/ioutil" + "io" "os" "strings" "testing" @@ -373,7 +373,7 @@ func podLogs(ctx context.Context, k8s kubernetes.Interface, namespace, name stri return "", err } defer logs.Close() - data, err := ioutil.ReadAll(logs) + data, err := io.ReadAll(logs) if err != nil { return "", err }