Skip to content

xds: make the bootstrap configuration a singleton #7346

@easwars

Description

@easwars

Currently, there are a few ways to create an xDS client

  • xdsclient.New: This uses bootstrap configuration defined by the env vars
  • xdsclient.NewWithConfig: This uses bootstrap configuration provided to it, if the bootstrap env vars are not defined.

This approach means that resolvers like google_c2p end up creating an xDS client even though they really don't need one. This is because they generate their own bootstrap configuration, and the only way to have the xDS client created with that configuration is to actually go ahead and create it.

Instead, if we have a way in the xdsclient package to set the global bootstrap configuration (for the process), then we can have resolvers like google_c2p simply set the configuration and not have to create an xDS client.

If we take this approach, we can also get rid of xdsclient.NewWithConfig and only have xdsclient.New.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions