storage

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: 11 Imported by: 0

Documentation

Overview

Package storage provides functions to manage enything related to storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPVCList

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

GetPVCList gathers the current list of PVCs in a namespace

func GetSnapshotList

func GetSnapshotList(
	ctx context.Context,
	crudClient client.Client,
	namespace string,
) (*volumesnapshotv1.VolumeSnapshotList, error)

GetSnapshotList gathers the current list of VolumeSnapshots in a namespace

func GetStorageAllowExpansion

func GetStorageAllowExpansion(
	ctx context.Context,
	crudClient client.Client,
	defaultStorageClass string,
) (*bool, error)

GetStorageAllowExpansion returns the boolean value of the 'AllowVolumeExpansion' value of the storage class

func IsWalStorageEnabled

func IsWalStorageEnabled(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
) (bool, error)

IsWalStorageEnabled returns true if 'WalStorage' is being used

func ObjectHasAnnotations

func ObjectHasAnnotations(
	object client.Object,
	annotations []string,
) bool

ObjectHasAnnotations returns true if the object has the passed annotations

func ObjectMatchesAnnotations

func ObjectMatchesAnnotations(
	object client.Object,
	annotations map[string]string,
) bool

ObjectMatchesAnnotations returns true if the object has the passed annotations key/value

func PvcHasLabels

func PvcHasLabels(
	pvc corev1.PersistentVolumeClaim,
	labels map[string]string,
) bool

PvcHasLabels returns true if a PVC contains a given map of labels

func SetSnapshotNameAsEnv

func SetSnapshotNameAsEnv(
	snapshotList *volumesnapshotv1.VolumeSnapshotList,
	backup *apiv1.Backup,
	envVars EnvVarsForSnapshots,
) error

SetSnapshotNameAsEnv sets the names of a PG_DATA, a PG_WAL and a list of PG_TABLESPACE snapshots from a given snapshotList as env variables

Types

type EnvVarsForSnapshots

type EnvVarsForSnapshots struct {
	DataSnapshot             string
	WalSnapshot              string
	TablespaceSnapshotPrefix string
}

EnvVarsForSnapshots represents the environment variables to use to track snapshots and apply them in test fixture templates

Jump to

Keyboard shortcuts

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