environments

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 11 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) (Environment, 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) 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) 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