clientv3: dial with context when creating authenticator

Otherwise, "grpc.Dial" blocks when "grpc.WithTimeout" dial
option gets deprecated.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-04-13 10:24:34 -07:00
parent 7ac2a2dd20
commit 037d7b4abe

View File

@ -216,8 +216,8 @@ func (auth *authenticator) close() {
auth.conn.Close()
}
func newAuthenticator(endpoint string, opts []grpc.DialOption, c *Client) (*authenticator, error) {
conn, err := grpc.Dial(endpoint, opts...)
func newAuthenticator(ctx context.Context, endpoint string, opts []grpc.DialOption, c *Client) (*authenticator, error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return nil, err
}