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

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-04-03 11:40:36 -07:00
parent 358a89c7e9
commit a729b88463

View File

@ -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.