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
Click to show internal directories.
Click to hide internal directories.