Documentation
¶
Overview ¶
Package namespaces provides utilities to manage namespaces
Index ¶
- Constants
- func CleanupClusterLogs(namespace string, testFailed bool) error
- func CreateNamespace(ctx context.Context, crudClient client.Client, name string, ...) error
- func CreateTestNamespace(ctx context.Context, crudClient client.Client, name string, ...) error
- func DeleteNamespaceAndWait(ctx context.Context, crudClient client.Client, name string, timeoutSeconds int) error
- func DumpNamespaceObjects(ctx context.Context, crudClient client.Client, namespace, filename string)
- func EnsureNamespace(ctx context.Context, crudClient client.Client, namespace string) error
- func GetEventList(ctx context.Context, crudClient client.Client, namespace string) (*eventsv1.EventList, error)
- func GetScheduledBackupList(ctx context.Context, crudClient client.Client, namespace string) (*apiv1.ScheduledBackupList, error)
- func GetServiceAccountList(ctx context.Context, crudClient client.Client, namespace string) (*corev1.ServiceAccountList, error)
Constants ¶
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
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 ¶
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.