namespaces

package
v1.28.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package namespaces provides utilities to manage namespaces

Index

Constants

View Source
const SternLogDirectory = "cluster_logs/"

SternLogDirectory contains the fixed path to store the cluster logs

Variables

This section is empty.

Functions

func CleanupClusterLogs added in v1.24.4

func CleanupClusterLogs(namespace string, testFailed bool) error

CleanupClusterLogs cleans up the cluster logs of a given namespace

func CreateNamespace

func CreateNamespace(
	ctx context.Context,
	crudClient client.Client,
	name string,
	opts ...client.CreateOption,
) error

CreateNamespace creates a namespace.

func CreateTestNamespace

func CreateTestNamespace(
	ctx context.Context,
	crudClient client.Client,
	name string,
	opts ...client.CreateOption,
) error

CreateTestNamespace creates a namespace creates a namespace. Prefer CreateUniqueTestNamespace instead, unless you need a specific namespace name. If so, make sure there is no collision potential. The namespace is automatically cleaned up at the end of the test.

func DeleteNamespaceAndWait

func DeleteNamespaceAndWait(
	ctx context.Context,
	crudClient client.Client,
	name string,
	timeoutSeconds int,
) error

DeleteNamespaceAndWait deletes a namespace if existent and returns when deletion is completed

func DumpNamespaceObjects

func DumpNamespaceObjects(
	ctx context.Context,
	crudClient client.Client,
	namespace, filename string,
)

DumpNamespaceObjects logs the clusters, pods, pvcs etc. found in a namespace as JSON sections

func EnsureNamespace

func EnsureNamespace(
	ctx context.Context,
	crudClient client.Client,
	namespace string,
) error

EnsureNamespace checks for the presence of a namespace, and if it does not exist, creates it

func GetEventList

func GetEventList(
	ctx context.Context,
	crudClient client.Client,
	namespace string,
) (*eventsv1.EventList, error)

GetEventList gathers the current list of events in a namespace

func GetScheduledBackupList

func GetScheduledBackupList(
	ctx context.Context,
	crudClient client.Client,
	namespace string,
) (*apiv1.ScheduledBackupList, error)

GetScheduledBackupList gathers the current list of scheduledBackup in namespace

func GetServiceAccountList

func GetServiceAccountList(
	ctx context.Context,
	crudClient client.Client,
	namespace string,
) (*corev1.ServiceAccountList, error)

GetServiceAccountList gathers the current list of jobs in a namespace

Types

This section is empty.

Jump to

Keyboard shortcuts

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