google-c2p resolver: add authority entry to bootstrap config (#5680)
This commit is contained in:
@ -110,14 +110,20 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
|
||||
if balancerName == "" {
|
||||
balancerName = tdURL
|
||||
}
|
||||
serverConfig := &bootstrap.ServerConfig{
|
||||
ServerURI: balancerName,
|
||||
Creds: grpc.WithCredentialsBundle(google.NewDefaultCredentials()),
|
||||
TransportAPI: version.TransportV3,
|
||||
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
|
||||
}
|
||||
config := &bootstrap.Config{
|
||||
XDSServer: &bootstrap.ServerConfig{
|
||||
ServerURI: balancerName,
|
||||
Creds: grpc.WithCredentialsBundle(google.NewDefaultCredentials()),
|
||||
TransportAPI: version.TransportV3,
|
||||
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
|
||||
},
|
||||
XDSServer: serverConfig,
|
||||
ClientDefaultListenerResourceNameTemplate: "%s",
|
||||
Authorities: map[string]*bootstrap.Authority{
|
||||
"traffic-director-c2p.xds.googleapis.com": {
|
||||
XDSServer: serverConfig,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// Create singleton xds client with this config. The xds client will be
|
||||
|
@ -211,13 +211,19 @@ func TestBuildXDS(t *testing.T) {
|
||||
},
|
||||
}
|
||||
}
|
||||
serverConfig := &bootstrap.ServerConfig{
|
||||
ServerURI: tdURL,
|
||||
TransportAPI: version.TransportV3,
|
||||
NodeProto: wantNode,
|
||||
}
|
||||
wantConfig := &bootstrap.Config{
|
||||
XDSServer: &bootstrap.ServerConfig{
|
||||
ServerURI: tdURL,
|
||||
TransportAPI: version.TransportV3,
|
||||
NodeProto: wantNode,
|
||||
},
|
||||
XDSServer: serverConfig,
|
||||
ClientDefaultListenerResourceNameTemplate: "%s",
|
||||
Authorities: map[string]*bootstrap.Authority{
|
||||
"traffic-director-c2p.xds.googleapis.com": {
|
||||
XDSServer: serverConfig,
|
||||
},
|
||||
},
|
||||
}
|
||||
if tt.tdURI != "" {
|
||||
wantConfig.XDSServer.ServerURI = tt.tdURI
|
||||
|
Reference in New Issue
Block a user