Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xds: enable XDS federation by default #6151

Merged
merged 3 commits into from Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/envconfig/xds.go
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
4 changes: 2 additions & 2 deletions xds/internal/xdsclient/xdsresource/name_test.go
Expand Up @@ -92,10 +92,10 @@ func TestParseName(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if tt.env {
if !tt.env {
defer func() func() {
oldEnv := envconfig.XDSFederation
envconfig.XDSFederation = true
envconfig.XDSFederation = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fix the failing test instead of disabling federation for the duration of this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I might be reading this wrong - this should only be disabling federation for the duration of the one test case that explicitly disables it, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I missed the if !tt.env.

Can we simplify this by getting rid of the if !tt.env?

	oldEnv := envconfig.XDSFederation
	envconfig.XDSFederation = tt.env
	defer func() { envconfig.XDSFederation = oldEnv }()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return func() { envconfig.XDSFederation = oldEnv }
}()()
}
Expand Down