mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Drop use of deprecated clientv3.SetLogger
This commit is contained in:
parent
2979c3325e
commit
52b629efbc
@ -19,12 +19,12 @@ package etcd3
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
clientv3 "go.etcd.io/etcd/client/v3"
|
"google.golang.org/grpc/grpclog"
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
clientv3.SetLogger(klogWrapper{})
|
grpclog.SetLoggerV2(klogWrapper{})
|
||||||
}
|
}
|
||||||
|
|
||||||
type klogWrapper struct{}
|
type klogWrapper struct{}
|
||||||
|
@ -67,7 +67,7 @@ func init() {
|
|||||||
utilruntime.Must(example.AddToScheme(scheme))
|
utilruntime.Must(example.AddToScheme(scheme))
|
||||||
utilruntime.Must(examplev1.AddToScheme(scheme))
|
utilruntime.Must(examplev1.AddToScheme(scheme))
|
||||||
|
|
||||||
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
|
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
|
||||||
}
|
}
|
||||||
|
|
||||||
// prefixTransformer adds and verifies that all data has the correct prefix on its way in and out.
|
// prefixTransformer adds and verifies that all data has the correct prefix on its way in and out.
|
||||||
|
@ -138,7 +138,7 @@ func RunCustomEtcd(dataDir string, customFlags []string) (url string, stopFn fun
|
|||||||
|
|
||||||
// Quiet etcd logs for integration tests
|
// Quiet etcd logs for integration tests
|
||||||
// Comment out to get verbose logs if desired
|
// Comment out to get verbose logs if desired
|
||||||
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
|
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
|
||||||
|
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
return "", nil, fmt.Errorf("failed to run etcd: %v", err)
|
return "", nil, fmt.Errorf("failed to run etcd: %v", err)
|
||||||
|
@ -24,7 +24,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
clientv3 "go.etcd.io/etcd/client/v3"
|
|
||||||
"google.golang.org/grpc/grpclog"
|
"google.golang.org/grpc/grpclog"
|
||||||
|
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
@ -204,7 +203,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func setupWithOptions(t *testing.T, instanceOptions *apitesting.TestServerInstanceOptions, flags []string) (client kubernetes.Interface, tearDown func()) {
|
func setupWithOptions(t *testing.T, instanceOptions *apitesting.TestServerInstanceOptions, flags []string) (client kubernetes.Interface, tearDown func()) {
|
||||||
clientv3.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
|
grpclog.SetLoggerV2(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, ioutil.Discard))
|
||||||
|
|
||||||
result := apitesting.StartTestServerOrDie(t, instanceOptions, flags, framework.SharedEtcd())
|
result := apitesting.StartTestServerOrDie(t, instanceOptions, flags, framework.SharedEtcd())
|
||||||
result.ClientConfig.AcceptContentTypes = ""
|
result.ClientConfig.AcceptContentTypes = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user