Documentation
¶
Index ¶
- type Builder
- func (b *Builder) Build(ctx context.Context) (env Environment, err error)
- func (b *Builder) WithAddons(addons ...clusters.Addon) *Builder
- func (b *Builder) WithCalicoCNI() *Builder
- func (b *Builder) WithClusterBuilder(builder clusters.Builder) *Builder
- func (b *Builder) WithExistingCluster(cluster clusters.Cluster) *Builder
- func (b *Builder) WithIPv6Only() *Builder
- func (b *Builder) WithKubernetesVersion(version semver.Version) *Builder
- func (b *Builder) WithName(name string) *Builder
- type Environment
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 ¶
WithAddons includes any provided Addon components in the cluster after the cluster is deployed.
func (*Builder) WithCalicoCNI ¶ added in v0.17.0
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
WithClusterBuilder instructs the environment builder to use a provided cluster builder instead of the default one.
func (*Builder) WithExistingCluster ¶
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
WithIPv6Only configures KIND to only use IPv6.
func (*Builder) WithKubernetesVersion ¶ added in v0.2.1
WithKubernetesVersion indicates which Kubernetes version to deploy clusters with, if the caller wants something other than the default.
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.