package bootstrap

import "google.golang.org/grpc/internal/testutils/xds/bootstrap"

Package bootstrap provides functionality to generate bootstrap configuration.

Index

Functions

func Contents

func Contents(opts Options) ([]byte, error)

Contents returns the contents to go into a bootstrap file, environment, or configuration passed to xds.NewXDSResolverWithConfigForTesting.

func CreateFile

func CreateFile(opts Options) (func(), error)

CreateFile creates a temporary file with bootstrap contents, based on the passed in options, and updates the bootstrap environment variable to point to this file.

Returns a cleanup function which will be non-nil if the setup process was completed successfully. It is the responsibility of the caller to invoke the cleanup function at the end of the test.

Types

type Options

type Options struct {
	// NodeID is the node identifier of the gRPC client/server node in the
	// proxyless service mesh.
	NodeID string
	// ServerURI is the address of the management server.
	ServerURI string
	// IgnoreResourceDeletion, if true, results in a bootstrap config with the
	// `server_features` list containing `ignore_resource_deletion`. This results
	// in gRPC ignoring resource deletions from the management server, as per A53.
	IgnoreResourceDeletion bool
	// ClientDefaultListenerResourceNameTemplate is the default listener
	// resource name template to be used on the gRPC client.
	ClientDefaultListenerResourceNameTemplate string
	// ServerListenerResourceNameTemplate is the listener resource name template
	// to be used on the gRPC server.
	ServerListenerResourceNameTemplate string
	// CertificateProviders is the certificate providers configuration.
	CertificateProviders map[string]json.RawMessage
	// Authorities is a list of non-default authorities.
	//
	// In the config, an authority contains {ServerURI, xds-version, creds,
	// features, etc}. Note that this fields only has ServerURI (it's a
	// map[authority-name]ServerURI). The other fields (version, creds,
	// features) are assumed to be the same as the default authority (they can
	// be added later if needed).
	//
	// If the env var corresponding to federation (envconfig.XDSFederation) is
	// set, an entry with empty string as the key and empty server config as
	// value will be added. This will be used by new style resource names with
	// an empty authority.
	Authorities map[string]string
}

Options wraps the parameters used to generate bootstrap configuration.

Source Files

bootstrap.go

Version
v1.64.0
Published
May 14, 2024
Platform
linux/amd64
Imports
5 packages
Last checked
47 minutes ago

Tools for package owners.