Skip to content

Commit 9fa3267

Browse files
authored
xds: remove xds client fallback environment variable (#8482)
1 parent 62ec29f commit 9fa3267

File tree

3 files changed

+0
-86
lines changed

3 files changed

+0
-86
lines changed

internal/envconfig/envconfig.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ var (
5252
// or "false".
5353
EnforceALPNEnabled = boolFromEnv("GRPC_ENFORCE_ALPN_ENABLED", true)
5454

55-
// XDSFallbackSupport is the env variable that controls whether support for
56-
// xDS fallback is turned on. If this is unset or is false, only the first
57-
// xDS server in the list of server configs will be used.
58-
XDSFallbackSupport = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FALLBACK", true)
59-
6055
// NewPickFirstEnabled is set if the new pickfirst leaf policy is to be used
6156
// instead of the exiting pickfirst implementation. This can be disabled by
6257
// setting the environment variable "GRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST"

internal/xds/bootstrap/bootstrap.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,6 @@ func (scs *ServerConfigs) UnmarshalJSON(data []byte) error {
106106
if err := json.Unmarshal(data, &servers); err != nil {
107107
return fmt.Errorf("xds: failed to JSON unmarshal server configurations during bootstrap: %v, config:\n%s", err, string(data))
108108
}
109-
// Only use the first server config if fallback support is disabled.
110-
if !envconfig.XDSFallbackSupport {
111-
if len(servers) > 1 {
112-
servers = servers[:1]
113-
}
114-
}
115109
*scs = servers
116110
return nil
117111
}

internal/xds/bootstrap/bootstrap_test.go

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,78 +1201,3 @@ func (s) TestNode_ToProto(t *testing.T) {
12011201
})
12021202
}
12031203
}
1204-
1205-
// Tests the case where the xDS fallback env var is set to false, and verifies
1206-
// that only the first server from the list of server configurations is used.
1207-
func (s) TestGetConfiguration_FallbackDisabled(t *testing.T) {
1208-
origFallbackEnv := envconfig.XDSFallbackSupport
1209-
envconfig.XDSFallbackSupport = false
1210-
defer func() { envconfig.XDSFallbackSupport = origFallbackEnv }()
1211-
1212-
cancel := setupBootstrapOverride(map[string]string{
1213-
"multipleXDSServers": `
1214-
{
1215-
"node": {
1216-
"id": "ENVOY_NODE_ID",
1217-
"metadata": {
1218-
"TRAFFICDIRECTOR_GRPC_HOSTNAME": "trafficdirector"
1219-
}
1220-
},
1221-
"xds_servers" : [
1222-
{
1223-
"server_uri": "trafficdirector.googleapis.com:443",
1224-
"channel_creds": [{ "type": "google_default" }],
1225-
"server_features": ["xds_v3"]
1226-
},
1227-
{
1228-
"server_uri": "backup.never.use.com:1234",
1229-
"channel_creds": [{ "type": "google_default" }]
1230-
}
1231-
],
1232-
"authorities": {
1233-
"xds.td.com": {
1234-
"xds_servers": [
1235-
{
1236-
"server_uri": "td.com",
1237-
"channel_creds": [ { "type": "google_default" } ],
1238-
"server_features" : ["xds_v3"]
1239-
},
1240-
{
1241-
"server_uri": "backup.never.use.com:1234",
1242-
"channel_creds": [{ "type": "google_default" }]
1243-
}
1244-
]
1245-
}
1246-
}
1247-
}`,
1248-
})
1249-
defer cancel()
1250-
1251-
wantConfig := &Config{
1252-
xDSServers: []*ServerConfig{{
1253-
serverURI: "trafficdirector.googleapis.com:443",
1254-
channelCreds: []ChannelCreds{{Type: "google_default"}},
1255-
serverFeatures: []string{"xds_v3"},
1256-
selectedCreds: ChannelCreds{Type: "google_default"},
1257-
}},
1258-
node: v3Node,
1259-
clientDefaultListenerResourceNameTemplate: "%s",
1260-
authorities: map[string]*Authority{
1261-
"xds.td.com": {
1262-
ClientListenerResourceNameTemplate: "xdstp://xds.td.com/envoy.config.listener.v3.Listener/%s",
1263-
XDSServers: []*ServerConfig{{
1264-
serverURI: "td.com",
1265-
channelCreds: []ChannelCreds{{Type: "google_default"}},
1266-
serverFeatures: []string{"xds_v3"},
1267-
selectedCreds: ChannelCreds{Type: "google_default"},
1268-
}},
1269-
},
1270-
},
1271-
}
1272-
t.Run("bootstrap_file_name", func(t *testing.T) {
1273-
testGetConfigurationWithFileNameEnv(t, "multipleXDSServers", false, wantConfig)
1274-
})
1275-
t.Run("bootstrap_file_contents", func(t *testing.T) {
1276-
testGetConfigurationWithFileContentEnv(t, "multipleXDSServers", false, wantConfig)
1277-
})
1278-
}

0 commit comments

Comments
 (0)