environments

package
v0.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Name string
	// contains filtered or unexported fields
}

Builder is a toolkit for building a new test Environment.

func NewBuilder

func NewBuilder() *Builder

NewBuilder generates a new empty Builder for creating Environments.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) (env Environment, err error)

Build is a blocking call to construct the configured Environment and it's underlying Kubernetes cluster. The amount of time that it blocks depends entirely on the underlying clusters.Cluster implementation that was requested.

func (*Builder) WithAddons

func (b *Builder) WithAddons(addons ...clusters.Addon) *Builder

WithAddons includes any provided Addon components in the cluster after the cluster is deployed.

func (*Builder) WithCalicoCNI added in v0.17.0

func (b *Builder) WithCalicoCNI() *Builder

WithCalicoCNI indicates that the CNI used for the cluster should be Calico as opposed to any other potential default CNI.

func (*Builder) WithClusterBuilder added in v0.23.0

func (b *Builder) WithClusterBuilder(builder clusters.Builder) *Builder

WithClusterBuilder instructs the environment builder to use a provided cluster builder instead of the default one.

func (*Builder) WithExistingCluster

func (b *Builder) WithExistingCluster(cluster clusters.Cluster) *Builder

WithExistingCluster causes the resulting environment to re-use an existing clusters.Cluster instead of creating a new one.

func (*Builder) WithIPv6Only added in v0.40.0

func (b *Builder) WithIPv6Only() *Builder

WithIPv6Only configures KIND to only use IPv6.

func (*Builder) WithKubernetesVersion added in v0.2.1

func (b *Builder) WithKubernetesVersion(version semver.Version) *Builder

WithKubernetesVersion indicates which Kubernetes version to deploy clusters with, if the caller wants something other than the default.

func (*Builder) WithName added in v0.1.0

func (b *Builder) WithName(name string) *Builder

WithName indicates a custom name to provide the testing environment

type Environment

type Environment interface {
	// Name indicates the unique name of the testing environment
	Name() string

	// Cluster provides access to the testing environment's Kubernetes cluster.
	Cluster() clusters.Cluster

	// Cleanup performs teardown and cleanup on all cluster components
	Cleanup(ctx context.Context) error

	// Ready indicates when the environment is ready and fully deployed,
	// or if errors occurred during provisioning of components.
	Ready(ctx context.Context) ([]runtime.Object, bool, error)

	// WaitForReady provides a nonblocking channel which can be used to wait
	// for readiness of the Environment. The channel has a timeout that is
	// based on the underlying env.Cluster.Type() and if no error is received
	// the caller may assume all runtime objects are resolved.
	WaitForReady(ctx context.Context) chan error
}

Environment represents a full test environment including components and other aspects of the environment used for testing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL