namespace

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package namespace implements helper functions for manipulating kubernetes namespaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestNamespace

func CreateTestNamespace(
	ctx context.Context,
	t *testing.T,
	k8s kubernetes.Interface,
	options ...TestNamespaceOption,
) (string, error)

CreateTestNamespace creates a namespace for testing

Types

type TestNamespaceConfig

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

TestNamespaceConfig defines the options for creating a test mamespace

func DefaultNamespaceConfig

func DefaultNamespaceConfig() TestNamespaceConfig

DefaultNamespaceConfig defines the default options for creating a test namespace

type TestNamespaceOption

type TestNamespaceOption func(TestNamespaceConfig) (TestNamespaceConfig, error)

TestNamespaceOption allows modifying an TestNamespaceConfig

func WithKeepOnFail

func WithKeepOnFail(keepOnFail bool) TestNamespaceOption

WithKeepOnFail indicates if the namespace must be kept in case the test fails

func WithName

func WithName(name string) TestNamespaceOption

WithName sets the name of the namespace

func WithPrefix

func WithPrefix(prefix string) TestNamespaceOption

WithPrefix sets the name of the namespace to a random name with the given prefix

Jump to

Keyboard shortcuts

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