Documentation ¶
Overview ¶
Package bootstrap provides the functionality to initialize certain aspects of an xDS client by reading a bootstrap file.
Index ¶
Constants ¶
const ( // XDSBootstrapFileNameEnv is the env variable to set bootstrap file name. // Do not use this and read from env directly. Its value is read and kept in // variable XDSBootstrapFileName. // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileNameEnv = "GRPC_XDS_BOOTSTRAP" // XDSBootstrapFileContentEnv is the env variable to set bootstrap file // content. Do not use this and read from env directly. Its value is read // and kept in variable XDSBootstrapFileContent. // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileContentEnv = "GRPC_XDS_BOOTSTRAP_CONFIG" )
Variables ¶
var ( // XDSBootstrapFileName holds the name of the file which contains xDS // bootstrap configuration. Users can specify the location of the bootstrap // file by setting the environment variable "GRPC_XDS_BOOTSTRAP". // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileName = os.Getenv(XDSBootstrapFileNameEnv) // XDSBootstrapFileContent holds the content of the xDS bootstrap // configuration. Users can specify the bootstrap config by setting the // environment variable "GRPC_XDS_BOOTSTRAP_CONFIG". // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileContent = os.Getenv(XDSBootstrapFileContentEnv) // GetCertificateProviderBuilder returns the registered builder for the // given name. This is set by package certprovider for use from xDS // bootstrap code while parsing certificate provider configs in the // bootstrap file. GetCertificateProviderBuilder any // func(string) certprovider.Builder )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // CertProviderConfigs contains a mapping from certificate provider plugin // instance names to parsed buildable configs. CertProviderConfigs map[string]*certprovider.BuildableConfig // NodeProto contains the Node proto to be used in xDS requests. This will be // of type *v3corepb.Node. NodeProto *v3corepb.Node }
Config provides the xDS client with several key bits of information that it requires in its interaction with the management server. The Config is initialized from the bootstrap file.
func NewConfigPartial ¶
NewConfigPartial returns a new instance of Config initialized by reading the bootstrap file found at ${GRPC_XDS_BOOTSTRAP} or bootstrap contents specified at ${GRPC_XDS_BOOTSTRAP_CONFIG}. If both env vars are set, the former is preferred.
Compared to the original `NewConfig()` function in the package `google.golang.org/grpc/xds/internal/xdsclient/bootstrap`, ([Source]: https://github.com/grpc/grpc-go/blob/v1.57.0/xds/internal/xdsclient/bootstrap/bootstrap.go#L414) this partial implementation only reads the `node` and `certificate_provider` sections.
We support a credential registration mechanism and only credentials registered through that mechanism will be accepted here. See package `xds/bootstrap` for details.