Skip to content

Commit

Permalink
xds: enable XDS federation by default (#6151)
Browse files Browse the repository at this point in the history
  • Loading branch information
apolcyn committed Mar 27, 2023
1 parent c018273 commit 44cebb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion internal/envconfig/xds.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var (
// XDSFederation indicates whether federation support is enabled, which can
// be enabled by setting the environment variable
// "GRPC_EXPERIMENTAL_XDS_FEDERATION" to "true".
XDSFederation = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FEDERATION", false)
XDSFederation = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FEDERATION", true)

// XDSRLS indicates whether processing of Cluster Specifier plugins and
// support for the RLS CLuster Specifier is enabled, which can be enabled by
Expand Down
16 changes: 5 additions & 11 deletions xds/internal/xdsclient/xdsresource/name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ func TestParseName(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if tt.env {
defer func() func() {
oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = true
return func() { envconfig.XDSFederation = oldEnv }
}()()
}
defer func() func() {
oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = tt.env
return func() { envconfig.XDSFederation = oldEnv }
}()()
got := ParseName(tt.in)
if !cmp.Equal(got, tt.want, cmpopts.IgnoreFields(Name{}, "processingDirective")) {
t.Errorf("ParseName() = %#v, want %#v", got, tt.want)
Expand All @@ -113,10 +111,6 @@ func TestParseName(t *testing.T) {
// TestNameStringCtxParamsOrder covers the case that if two names differ only in
// context parameter __order__, the parsed name.String() has the same value.
func TestNameStringCtxParamsOrder(t *testing.T) {
oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = true
defer func() { envconfig.XDSFederation = oldEnv }()

const (
a = "xdstp://auth/type/id?a=1&b=2"
b = "xdstp://auth/type/id?b=2&a=1"
Expand Down

0 comments on commit 44cebb8

Please sign in to comment.