xds/c2p: fix default client resource template, and xds-client target scheme (#5010)

This commit is contained in:
Menghan Li 2021-11-30 15:26:31 -08:00 committed by GitHub
parent 58beff180d
commit 872a6f12e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,7 @@ import (
const ( const (
c2pScheme = "google-c2p" c2pScheme = "google-c2p"
tdURL = "directpath-pa.googleapis.com" tdURL = "dns:///directpath-pa.googleapis.com"
httpReqTimeout = 10 * time.Second httpReqTimeout = 10 * time.Second
zoneURL = "http://metadata.google.internal/computeMetadata/v1/instance/zone" zoneURL = "http://metadata.google.internal/computeMetadata/v1/instance/zone"
ipv6URL = "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ipv6s" ipv6URL = "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ipv6s"
@ -110,6 +110,7 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
TransportAPI: version.TransportV3, TransportAPI: version.TransportV3,
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh), NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
}, },
ClientDefaultListenerResourceNameTemplate: "%s",
} }
// Create singleton xds client with this config. The xds client will be // Create singleton xds client with this config. The xds client will be

View File

@ -217,6 +217,7 @@ func TestBuildXDS(t *testing.T) {
TransportAPI: version.TransportV3, TransportAPI: version.TransportV3,
NodeProto: wantNode, NodeProto: wantNode,
}, },
ClientDefaultListenerResourceNameTemplate: "%s",
} }
if tt.tdURI != "" { if tt.tdURI != "" {
wantConfig.XDSServer.ServerURI = tt.tdURI wantConfig.XDSServer.ServerURI = tt.tdURI