|
@@ -21,10 +21,10 @@ import (
|
|
|
"go.etcd.io/etcd/etcdserver"
|
|
"go.etcd.io/etcd/etcdserver"
|
|
|
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
|
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
|
|
|
|
|
|
|
- "github.com/grpc-ecosystem/go-grpc-middleware"
|
|
|
|
|
- "github.com/grpc-ecosystem/go-grpc-prometheus"
|
|
|
|
|
|
|
+ grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
|
|
|
|
+ grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
|
|
|
|
+ "go.etcd.io/etcd/clientv3/credentials"
|
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc"
|
|
|
- "google.golang.org/grpc/credentials"
|
|
|
|
|
"google.golang.org/grpc/health"
|
|
"google.golang.org/grpc/health"
|
|
|
healthpb "google.golang.org/grpc/health/grpc_health_v1"
|
|
healthpb "google.golang.org/grpc/health/grpc_health_v1"
|
|
|
)
|
|
)
|
|
@@ -39,7 +39,8 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config, gopts ...grpc.ServerOptio
|
|
|
var opts []grpc.ServerOption
|
|
var opts []grpc.ServerOption
|
|
|
opts = append(opts, grpc.CustomCodec(&codec{}))
|
|
opts = append(opts, grpc.CustomCodec(&codec{}))
|
|
|
if tls != nil {
|
|
if tls != nil {
|
|
|
- opts = append(opts, grpc.Creds(credentials.NewTLS(tls)))
|
|
|
|
|
|
|
+ bundle := credentials.NewBundle(credentials.Config{TLSConfig: tls})
|
|
|
|
|
+ opts = append(opts, grpc.Creds(bundle.TransportCredentials()))
|
|
|
}
|
|
}
|
|
|
opts = append(opts, grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
|
|
opts = append(opts, grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
|
|
|
newLogUnaryInterceptor(s),
|
|
newLogUnaryInterceptor(s),
|