Merge pull request #910 from menghanl/balancer_start_creds_clone
Use creds.Clone in balancer.start
This commit is contained in:
@ -288,8 +288,12 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
|
|||||||
// Connect to target directly if balancer is nil.
|
// Connect to target directly if balancer is nil.
|
||||||
addrs = append(addrs, Address{Addr: target})
|
addrs = append(addrs, Address{Addr: target})
|
||||||
} else {
|
} else {
|
||||||
|
var credsClone credentials.TransportCredentials
|
||||||
|
if creds != nil {
|
||||||
|
credsClone = creds.Clone()
|
||||||
|
}
|
||||||
config := BalancerConfig{
|
config := BalancerConfig{
|
||||||
DialCreds: creds,
|
DialCreds: credsClone,
|
||||||
}
|
}
|
||||||
if err := cc.dopts.balancer.Start(target, config); err != nil {
|
if err := cc.dopts.balancer.Start(target, config); err != nil {
|
||||||
waitC <- err
|
waitC <- err
|
||||||
|
Reference in New Issue
Block a user