Skip to content

Commit

Permalink
comments (on comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Oct 30, 2019
1 parent 5518716 commit e86ba20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion balancer/grpclb/grpclb.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func (lb *lbBalancer) UpdateClientConnState(ccs balancer.ClientConnState) error

addrs := ccs.ResolverState.Addresses
if len(addrs) == 0 {
// There's should be at least one address, either grpclb server or
// There should be at least one address, either grpclb server or
// fallback. Empty address is not valid.
return balancer.ErrBadResolverState
}
Expand Down
7 changes: 3 additions & 4 deletions balancer/grpclb/grpclb_remote_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,10 @@ func (lb *lbBalancer) newRemoteBalancerCCWrapper() {
PermitWithoutStream: true,
}))

// DialContext using manualResolver.Scheme, which is a random scheme
// generated when init grpclb. The target scheme here is not important.
// The dial target 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.
// The grpclb server addresses will set field ServerName, and creds will
// receive ServerName as authority.
cc, err := grpc.DialContext(context.Background(), "grpclb.subClientConn", dopts...)
if err != nil {
grpclog.Fatalf("failed to dial: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion balancer/grpclb/grpclb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *serverNameCheckCreds) ClientHandshake(ctx context.Context, authority st
}
if authority != string(b) {
fmt.Printf("test-creds: got authority from ClientConn %q, expected by server %q\n", authority, string(b))
return nil, nil, errors.New("received unexpected server nameq")
return nil, nil, errors.New("received unexpected server name")
}
return rawConn, nil, nil
}
Expand Down

0 comments on commit e86ba20

Please sign in to comment.