bootstrap

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadImagesToKindCluster

func LoadImagesToKindCluster(ctx context.Context, input LoadImagesToKindClusterInput) error

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.

Types

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.

Jump to

Keyboard shortcuts

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