envfuncs

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 12 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKindCluster

func CreateKindCluster(clusterName string) env.Func

CreateKindCluster returns an env.Func that is used to create a kind cluster that is then injected in the context using the name as a key.

NOTE: the returned function will update its env config with the kubeconfig file for the config client.

func CreateKindClusterWithConfig added in v0.0.4

func CreateKindClusterWithConfig(clusterName, image, configFilePath string) env.Func

CreateKindClusterWithConfig returns an env.Func that is used to create a kind cluster that is then injected in the context using the name as a key.

NOTE: the returned function will update its env config with the kubeconfig file for the config client.

func CreateNamespace

func CreateNamespace(name string) env.Func

CreateNamespace provides an Environment.Func that creates a new namespace API object and stores it the context using its name as key.

NOTE: the returned environment function automatically updates the env config, it receives, with the namespace to make it available for subsequent call.

func DeleteNamespace

func DeleteNamespace(name string) env.Func

DeleteNamespace provides an Environment.Func that deletes the named namespace. It first searches for the ns in its context, if not found then attempt to retrieve it from the API server. Then deletes it.

func DestroyKindCluster

func DestroyKindCluster(name string) env.Func

DestroyKindCluster returns an EnvFunc that retrieves a previously saved kind Cluster in the context (using the name), then deletes it.

NOTE: this should be used in a Environment.Finish step.

func LoadDockerImageToCluster added in v0.0.5

func LoadDockerImageToCluster(name, image string) env.Func

LoadDockerImageToCluster returns an EnvFunc that retrieves a previously saved kind Cluster in the context (using the name), and then loads a docker image from the host into the cluster.

func LoadImageArchiveToCluster added in v0.0.5

func LoadImageArchiveToCluster(name, imageArchive string) env.Func

LoadImageArchiveToCluster returns an EnvFunc that retrieves a previously saved kind Cluster in the context (using the name), and then loads a docker image TAR archive from the host into the cluster.

func SetupCRDs added in v0.0.7

func SetupCRDs(crdPath, pattern string) env.Func

SetupCRDs is provided as a helper env.Func handler that can be used to setup the CRDs that are required to process your controller code for testing. For additional control on resource creation handling, please use the decoder.ApplyWithManifestDir directly with suitable arguments to customize the behavior

func TeardownCRDs added in v0.0.7

func TeardownCRDs(crdPath, pattern string) env.Func

TeardownCRDs is provided as a handler function that can be hooked into your test's teardown sequence to make sure that you can cleanup the CRDs that were setup as part of the SetupCRDs hook

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳