Skip to content

Commit

Permalink
set grpc dial grpclb server target to remoteLBName that comes from re…
Browse files Browse the repository at this point in the history
…solver
  • Loading branch information
menghanl committed Sep 20, 2018
1 parent 6d5d5e1 commit f8a6a2d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions balancer/grpclb/grpclb_remote_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,12 @@ func (lb *lbBalancer) dialRemoteLB(remoteLBName string) {
dopts = append(dopts, grpc.WithChannelzParentID(lb.opt.ChannelzParentID))
}

// DialContext using manualResolver.Scheme, which is a random scheme generated
// when init grpclb. The target name is not important.
cc, err := grpc.DialContext(context.Background(), "grpclb:///grpclb.server", dopts...)
// DialContext using manualResolver.Scheme, which is a random scheme
// generated when init grpclb. The target scheme here is not important.
//
// The grpc dial target will be used by the creds (ALTS) as the authority,
// so it has to be set to remoteLBName that comes from resolver.
cc, err := grpc.DialContext(context.Background(), remoteLBName, dopts...)
if err != nil {
grpclog.Fatalf("failed to dial: %v", err)
}
Expand Down

0 comments on commit f8a6a2d

Please sign in to comment.