Back to godoc.org
sigs.k8s.io/cluster-api / test / framework / bootstrap

package bootstrap

v0.3.7
Latest Go to latest
Published: 1 day ago | License: Apache-2.0 | Module: sigs.k8s.io/cluster-api

Index

Package Files

func LoadImagesToKindCluster

func LoadImagesToKindCluster(ctx context.Context, input LoadImagesToKindClusterInput)

LoadImagesToKindCluster provides a utility for loading images into a kind cluster.

func NewKindClusterProvider

func NewKindClusterProvider(name string, options ...KindClusterOption) *kindClusterProvider

NewKindClusterProvider returns a ClusterProvider that can create a kind cluster.

type ClusterProvider

type ClusterProvider interface {
	// Create a Kubernetes cluster.
	// Generally to be used in the BeforeSuite function to create a Kubernetes cluster to be shared between tests.
	Create(context.Context)

	// GetKubeconfigPath returns the path to the kubeconfig file to be used to access the Kubernetes cluster.
	GetKubeconfigPath() string

	// Dispose will completely clean up the provisioned cluster.
	// This should be implemented as a synchronous function.
	// Generally to be used in the AfterSuite function if a Kubernetes cluster is shared between tests.
	// Should try to clean everything up and report any dangling artifacts that needs manual intervention.
	Dispose(context.Context)
}

ClusterProvider defines the behavior of a type that is responsible for provisioning and managing a Kubernetes cluster.

func CreateKindBootstrapClusterAndLoadImages

func CreateKindBootstrapClusterAndLoadImages(ctx context.Context, input CreateKindBootstrapClusterAndLoadImagesInput) ClusterProvider

CreateKindBootstrapClusterAndLoadImages returns a new Kubernetes cluster with pre-loaded images.

type CreateKindBootstrapClusterAndLoadImagesInput

type CreateKindBootstrapClusterAndLoadImagesInput struct {
	// Name of the cluster
	Name string

	// RequiresDockerSock defines if the cluster requires the docker sock
	RequiresDockerSock bool

	// Images to be loaded in the cluster (this is kind specific)
	Images []framework.ContainerImage
}

CreateKindBootstrapClusterAndLoadImagesInput is the input for CreateKindBootstrapClusterAndLoadImages.

type KindClusterOption

type KindClusterOption interface {
	// contains filtered or unexported methods
}

KindClusterOption is a NewKindClusterProvider option

func WithDockerSockMount

func WithDockerSockMount() KindClusterOption

WithDockerSockMount implements a New Option that instruct the kindClusterProvider to mount /var/run/docker.sock into the new kind cluster.

type LoadImagesToKindClusterInput

type LoadImagesToKindClusterInput struct {
	// Name of the cluster
	Name string

	// Images to be loaded in the cluster (this is kind specific)
	Images []framework.ContainerImage
}

LoadImagesToKindClusterInput is the input for LoadImagesToKindCluster.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier