Skip to content

Commit

Permalink
googlec2p: use xdstp style template for client LDS resource name (#7048)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvindbr8 authored Mar 19, 2024
1 parent faf9964 commit 4ffccf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions xds/googledirectpath/googlec2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
{
"server_uri": "%s",
"channel_creds": [{"type": "google_default"}],
"server_features": ["xds_v3", "ignore_resource_deletion"]
"server_features": ["xds_v3", "ignore_resource_deletion", "xds.config.resource-in-sotw"]
}`, balancerName)))
if err != nil {
return nil, fmt.Errorf("failed to build bootstrap configuration: %v", err)
Expand All @@ -120,7 +120,8 @@ func (c2pResolverBuilder) Build(t resolver.Target, cc resolver.ClientConn, opts
ClientDefaultListenerResourceNameTemplate: "%s",
Authorities: map[string]*bootstrap.Authority{
c2pAuthority: {
XDSServer: serverConfig,
XDSServer: serverConfig,
ClientListenerResourceNameTemplate: fmt.Sprintf("xdstp://%s/envoy.config.listener.v3.Listener/%%s", c2pAuthority),
},
},
NodeProto: newNode(<-zoneCh, <-ipv6CapableCh),
Expand Down
5 changes: 3 additions & 2 deletions xds/googledirectpath/googlec2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestBuildXDS(t *testing.T) {
wantServerConfig, err := bootstrap.ServerConfigFromJSON([]byte(fmt.Sprintf(`{
"server_uri": "%s",
"channel_creds": [{"type": "google_default"}],
"server_features": ["xds_v3", "ignore_resource_deletion"]
"server_features": ["xds_v3", "ignore_resource_deletion", "xds.config.resource-in-sotw"]
}`, tdURL)))
if err != nil {
t.Fatalf("Failed to build server bootstrap config: %v", err)
Expand All @@ -223,7 +223,8 @@ func TestBuildXDS(t *testing.T) {
ClientDefaultListenerResourceNameTemplate: "%s",
Authorities: map[string]*bootstrap.Authority{
"traffic-director-c2p.xds.googleapis.com": {
XDSServer: wantServerConfig,
XDSServer: wantServerConfig,
ClientListenerResourceNameTemplate: "xdstp://traffic-director-c2p.xds.googleapis.com/envoy.config.listener.v3.Listener/%s",
},
},
NodeProto: wantNode,
Expand Down

0 comments on commit 4ffccf1

Please sign in to comment.