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 == "" {
|
if balancerName == "" {
|
||||||
balancerName = tdURL
|
balancerName = tdURL
|
||||||
}
|
}
|
||||||
config := &bootstrap.Config{
|
serverConfig := &bootstrap.ServerConfig{
|
||||||
XDSServer: &bootstrap.ServerConfig{
|
|
||||||
ServerURI: balancerName,
|
ServerURI: balancerName,
|
||||||
Creds: grpc.WithCredentialsBundle(google.NewDefaultCredentials()),
|
Creds: grpc.WithCredentialsBundle(google.NewDefaultCredentials()),
|
||||||
TransportAPI: version.TransportV3,
|
TransportAPI: version.TransportV3,
|
||||||
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
|
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
|
||||||
},
|
}
|
||||||
|
config := &bootstrap.Config{
|
||||||
|
XDSServer: serverConfig,
|
||||||
ClientDefaultListenerResourceNameTemplate: "%s",
|
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
|
// Create singleton xds client with this config. The xds client will be
|
||||||
|
@ -211,13 +211,19 @@ func TestBuildXDS(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wantConfig := &bootstrap.Config{
|
serverConfig := &bootstrap.ServerConfig{
|
||||||
XDSServer: &bootstrap.ServerConfig{
|
|
||||||
ServerURI: tdURL,
|
ServerURI: tdURL,
|
||||||
TransportAPI: version.TransportV3,
|
TransportAPI: version.TransportV3,
|
||||||
NodeProto: wantNode,
|
NodeProto: wantNode,
|
||||||
},
|
}
|
||||||
|
wantConfig := &bootstrap.Config{
|
||||||
|
XDSServer: serverConfig,
|
||||||
ClientDefaultListenerResourceNameTemplate: "%s",
|
ClientDefaultListenerResourceNameTemplate: "%s",
|
||||||
|
Authorities: map[string]*bootstrap.Authority{
|
||||||
|
"traffic-director-c2p.xds.googleapis.com": {
|
||||||
|
XDSServer: serverConfig,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
if tt.tdURI != "" {
|
if tt.tdURI != "" {
|
||||||
wantConfig.XDSServer.ServerURI = tt.tdURI
|
wantConfig.XDSServer.ServerURI = tt.tdURI
|
||||||
|
Reference in New Issue
Block a user