Skip to content

Commit

Permalink
Merge pull request #822 from gy95/ioutil
Browse files Browse the repository at this point in the history
replace deprecated package io/ioutil with packages io and os
  • Loading branch information
karmada-bot authored Oct 16, 2021
2 parents cceed5c + ab3f176 commit e55ed1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/clusterdiscovery/clusterapi/clusterapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package clusterapi
import (
"context"
"fmt"
"io/ioutil"
"os"
"time"

corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package e2e
import (
"context"
"fmt"
"io/ioutil"
"io"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit e55ed1e

Please sign in to comment.