io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
@@ -20,7 +20,7 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -104,7 +104,7 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
|
||||
|
||||
klog.Infof("starting etcd on %s", customURL)
|
||||
|
||||
etcdDataDir, err := ioutil.TempDir(os.TempDir(), dataDir)
|
||||
etcdDataDir, err := os.MkdirTemp(os.TempDir(), dataDir)
|
||||
if err != nil {
|
||||
return "", nil, fmt.Errorf("unable to make temp etcd data dir %s: %v", dataDir, err)
|
||||
}
|
||||
@@ -139,7 +139,7 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
|
||||
|
||||
// Quiet etcd logs for integration tests
|
||||
// Comment out to get verbose logs if desired
|
||||
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
|
||||
grpclog.SetLoggerV2(grpclog.NewLoggerV2(io.Discard, io.Discard, os.Stderr))
|
||||
|
||||
if err := cmd.Start(); err != nil {
|
||||
return "", nil, fmt.Errorf("failed to run etcd: %v", err)
|
||||
|
Reference in New Issue
Block a user