Explorar o código

functional-tester/rpcpb: support grpc.DialOption for "CreateEtcdClient"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee %!s(int64=8) %!d(string=hai) anos
pai
achega
a729b88463
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      tools/functional-tester/rpcpb/member.go

+ 7 - 5
tools/functional-tester/rpcpb/member.go

@@ -41,15 +41,17 @@ func (m *Member) DialEtcdGRPCServer(opts ...grpc.DialOption) (*grpc.ClientConn,
 }
 
 // CreateEtcdClient creates a client from member.
-func (m *Member) CreateEtcdClient() (*clientv3.Client, error) {
+func (m *Member) CreateEtcdClient(opts ...grpc.DialOption) (*clientv3.Client, error) {
+	cfg := clientv3.Config{
+		Endpoints:   []string{m.EtcdClientEndpoint},
+		DialTimeout: 5 * time.Second,
+		DialOptions: opts,
+	}
 	if m.EtcdClientTLS {
 		// TODO: support TLS
 		panic("client TLS not supported yet")
 	}
-	return clientv3.New(clientv3.Config{
-		Endpoints:   []string{m.EtcdClientEndpoint},
-		DialTimeout: 5 * time.Second,
-	})
+	return clientv3.New(cfg)
 }
 
 // CheckCompact ensures that historical data before given revision has been compacted.