helpers

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package helpers contains helpers for creating a test environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeWebhookInEnvironment added in v1.11.0

func InitializeWebhookInEnvironment(e *envtest.Environment, configPath string)

InitializeWebhookInEnvironment initializes WebhookInstallOptions for the provided environment.

Types

type Mod

type Mod struct {
	// contains filtered or unexported fields
}

Mod wraps a go.mod file.

func NewMod

func NewMod(path string) (Mod, error)

NewMod created a new Mod reading a go.mod file.

func (Mod) FindDependencyVersion

func (m Mod) FindDependencyVersion(dependency string) (string, error)

FindDependencyVersion return the version of a go.mod dependency.

type TestEnvironment

type TestEnvironment struct {
	manager.Manager
	client.Client
	Config    *rest.Config
	Simulator *vcsim.Simulator
	// contains filtered or unexported fields
}

TestEnvironment encapsulates a Kubernetes local test environment.

func NewTestEnvironment

func NewTestEnvironment(ctx context.Context) *TestEnvironment

NewTestEnvironment creates a new environment spinning up a local api-server.

func (*TestEnvironment) Cleanup

func (t *TestEnvironment) Cleanup(ctx context.Context, objs ...client.Object) error

Cleanup removes objects from the TestEnvironment.

func (*TestEnvironment) CleanupAndWait added in v1.11.0

func (t *TestEnvironment) CleanupAndWait(ctx context.Context, objs ...client.Object) error

CleanupAndWait removes objects from the TestEnvironment and waits for them to be gone.

func (*TestEnvironment) CreateKubeconfigSecret

func (t *TestEnvironment) CreateKubeconfigSecret(ctx context.Context, cluster *clusterv1.Cluster) error

CreateKubeconfigSecret creates a secret with the KubeConfig to access a cluster in the TestEnvironment.

func (*TestEnvironment) CreateNamespace

func (t *TestEnvironment) CreateNamespace(ctx context.Context, generateName string) (*corev1.Namespace, error)

CreateNamespace creates a new namespace in the TestEnvironment.

func (*TestEnvironment) StartManager

func (t *TestEnvironment) StartManager(ctx context.Context) error

StartManager starts the TestEnvironment's controller runtime manager.

func (*TestEnvironment) Stop

func (t *TestEnvironment) Stop() error

Stop stops the TestEnvironment's controller runtime manager.

func (*TestEnvironment) WaitForWebhooks

func (t *TestEnvironment) WaitForWebhooks()

WaitForWebhooks waits for TestEnvironment's webhooks to accept connections.

Directories

Path Synopsis
Package vcsim contains tools for running a VCenter simulator.
Package vcsim contains tools for running a VCenter simulator.
Package vmware contains context objects for testing.
Package vmware contains context objects for testing.

Jump to

Keyboard shortcuts

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