ksuite

package module
v0.0.0-...-cbe1720 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: MIT Imports: 16 Imported by: 0

README

Kube Suite

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SuiteStartClusterOpts = StartClusterOpts{}

SuiteStartClusterOpts are start cluster options that are used within the KubeSuite.

View Source
var SuiteStopClusterOpts = StopClusterOpts{}

SuiteStopClusterOpts are stop cluster options that are used within the KubeSuite.

Functions

func StopCluster

func StopCluster(cluster *TestClusterConfig, _ StopClusterOpts) error

Types

type KubeSuite

type KubeSuite struct {
	suite.Suite

	ClusterConfig *TestClusterConfig
}

KubeSuite a Testify Suite that creates a cluster and contains the config for that cluster. It is up to the user of this library to initialize the cluster

For example:

func (*KubeSuite) SetupSuite

func (k *KubeSuite) SetupSuite()

func (*KubeSuite) TearDownSuite

func (k *KubeSuite) TearDownSuite()

type StartClusterOpts

type StartClusterOpts struct {
	// If not set, defaults to the latest K3s version. You can find K3s tags at https://hub.docker.com/r/rancher/k3s/tags.
	K3sImageTag string

	// Creation options that are merged into the default. If not specified, a small K3s server with a single server and no agents is started.
	K3dCreateClusterOpts *v1alpha2.SimpleConfig

	Silent bool
}

StartClusterOpts options to start the cluster.

type StopClusterOpts

type StopClusterOpts struct {
}

type TestClusterConfig

type TestClusterConfig struct {
	KubeConfig *api.Config
	RestConfig *rest.Config
	K3dCluster *k3d.Cluster
	Name       string
}

func StartCluster

func StartCluster(opts StartClusterOpts) (*TestClusterConfig, error)

StartCluster creates a small and ephemeral K3s cluster for testing purposes.

Jump to

Keyboard shortcuts

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