envfuncs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoadDockerImageToCluster = LoadImageToCluster

Functions

func CreateCluster added in v0.3.0

func CreateCluster(p support.E2EClusterProvider, clusterName string) env.Func

CreateCluster returns an env.Func that is used to create an E2E provider 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 CreateClusterWithConfig added in v0.3.0

func CreateClusterWithConfig(p support.E2EClusterProvider, clusterName, configFilePath string, opts ...support.ClusterOpts) env.Func

CreateClusterWithConfig returns an env.Func that is used to create a e2e provider 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 CreateKindCluster deprecated

func CreateKindCluster(clusterName string) env.Func

Deprecated: This handler has been deprecated in favor of CreateCluster which can now accept support.ClusterProvider type as input in order to setup the cluster using right providers

func CreateKindClusterWithConfig deprecated added in v0.0.4

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

Deprecated: This handler has been deprecated in favor of CreateClusterWithConfig which can now accept support.ClusterProvider type as input in order to setup the cluster using right providers

func CreateNamespace

func CreateNamespace(name string, opts ...CreateNamespaceOpts) 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 DestroyCluster added in v0.3.0

func DestroyCluster(name string) env.Func

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

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

func DestroyKindCluster deprecated

func DestroyKindCluster(name string) env.Func

Deprecated: This handler has been deprecated in favor of DestroyCluster

func ExportClusterLogs added in v0.3.0

func ExportClusterLogs(name, dest string) env.Func

ExportClusterLogs returns an EnvFunc that retrieves a previously saved e2e provider Cluster in the context (using the name), and then export cluster logs in the provided destination.

func ExportKindClusterLogs deprecated added in v0.2.0

func ExportKindClusterLogs(name, dest string) env.Func

Deprecated: This handler has been deprecated in favor of ExportClusterLogs

func GetClusterFromContext added in v0.3.0

func GetClusterFromContext(ctx context.Context, clusterName string) (support.E2EClusterProvider, bool)

GetClusterFromContext helps extract the E2EClusterProvider object from the context. This can be used to setup and run tests of multi cluster e2e Prioviders.

func GetKindClusterFromContext deprecated added in v0.0.8

func GetKindClusterFromContext(ctx context.Context, clusterName string) (*kind.Cluster, bool)

Deprecated: This handler has been deprecated in favor of GetClusterFromContext

func LoadImageArchiveToCluster added in v0.0.5

func LoadImageArchiveToCluster(name, imageArchive string) env.Func

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

func LoadImageToCluster added in v0.3.0

func LoadImageToCluster(name, image string) env.Func

LoadImageToCluster returns an EnvFunc that retrieves a previously saved e2e provider Cluster in the context (using the name), and then loads a container image 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

type CreateNamespaceOpts added in v0.4.0

type CreateNamespaceOpts func(klient.Client, *corev1.Namespace)

func WithAnnotations added in v0.4.0

func WithAnnotations(annotations map[string]string) CreateNamespaceOpts

WithAnnotations provides an option to set custom annotations on the namespace.

func WithLabels added in v0.4.0

func WithLabels(labels map[string]string) CreateNamespaceOpts

WithLabels provides an option to set custom labels on the namespace.

type NamespaceContextKey added in v0.4.0

type NamespaceContextKey string

Jump to

Keyboard shortcuts

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