You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xds/googlec2p: support custom bootstrap config per channel. (#8648)
xds/googlec2p: Fix channel-specific xDS bootstrap configurations by
allowing xdsclient creation with per-target config. Removes global
fallback config usage, enabling multiple distinct xDS clients to coexist
in the same process.
// If the environment variables are not set, then fallback bootstrap
265
-
// configuration should be set before attempting to create an xDS client,
266
-
// else xDS client creation will fail.
267
-
config=p.fallbackConfig
282
+
varerrerror
283
+
config, err=p.getConfiguration()
284
+
iferr!=nil {
285
+
returnnil, nil, fmt.Errorf("xds: failed to read xDS bootstrap config from env vars: %v", err)
286
+
}
287
+
ifconfig==nil {
288
+
// If the environment variables are not set, then fallback bootstrap
289
+
// configuration should be set before attempting to create an xDS client,
290
+
// else xDS client creation will fail.
291
+
config=p.fallbackConfig
292
+
}
268
293
}
294
+
269
295
ifconfig==nil {
270
296
returnnil, nil, fmt.Errorf("failed to read xDS bootstrap config from env vars: bootstrap environment variables (%q or %q) not defined and fallback config not set", envconfig.XDSBootstrapFileNameEnv, envconfig.XDSBootstrapFileContentEnv)
0 commit comments