xds: enable XDS federation by default (#6151)

This commit is contained in:
apolcyn 2023-03-27 15:23:22 -07:00 committed by GitHub
parent c018273e53
commit 44cebb8ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -79,7 +79,7 @@ var (
// XDSFederation indicates whether federation support is enabled, which can // XDSFederation indicates whether federation support is enabled, which can
// be enabled by setting the environment variable // be enabled by setting the environment variable
// "GRPC_EXPERIMENTAL_XDS_FEDERATION" to "true". // "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 // XDSRLS indicates whether processing of Cluster Specifier plugins and
// support for the RLS CLuster Specifier is enabled, which can be enabled by // support for the RLS CLuster Specifier is enabled, which can be enabled by

View File

@ -92,13 +92,11 @@ func TestParseName(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
if tt.env {
defer func() func() { defer func() func() {
oldEnv := envconfig.XDSFederation oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = true envconfig.XDSFederation = tt.env
return func() { envconfig.XDSFederation = oldEnv } return func() { envconfig.XDSFederation = oldEnv }
}()() }()()
}
got := ParseName(tt.in) got := ParseName(tt.in)
if !cmp.Equal(got, tt.want, cmpopts.IgnoreFields(Name{}, "processingDirective")) { if !cmp.Equal(got, tt.want, cmpopts.IgnoreFields(Name{}, "processingDirective")) {
t.Errorf("ParseName() = %#v, want %#v", got, tt.want) t.Errorf("ParseName() = %#v, want %#v", got, tt.want)
@ -113,10 +111,6 @@ func TestParseName(t *testing.T) {
// TestNameStringCtxParamsOrder covers the case that if two names differ only in // TestNameStringCtxParamsOrder covers the case that if two names differ only in
// context parameter __order__, the parsed name.String() has the same value. // context parameter __order__, the parsed name.String() has the same value.
func TestNameStringCtxParamsOrder(t *testing.T) { func TestNameStringCtxParamsOrder(t *testing.T) {
oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = true
defer func() { envconfig.XDSFederation = oldEnv }()
const ( const (
a = "xdstp://auth/type/id?a=1&b=2" a = "xdstp://auth/type/id?a=1&b=2"
b = "xdstp://auth/type/id?b=2&a=1" b = "xdstp://auth/type/id?b=2&a=1"