backups

package
v1.25.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package backups provides backup utilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBackupConditionInClusterStatus

func AssertBackupConditionInClusterStatus(
	ctx context.Context,
	crudClient client.Client,
	namespace, clusterName string,
)

AssertBackupConditionInClusterStatus check that the backup condition in the Cluster's Status eventually returns true

func ComposeAzBlobListAzuriteCmd

func ComposeAzBlobListAzuriteCmd(clusterName, path string) string

ComposeAzBlobListAzuriteCmd builds the Azure storage blob list command for Azurite

func ComposeAzBlobListCmd

func ComposeAzBlobListCmd(
	configuration AzureConfiguration,
	clusterName,
	path string,
) string

ComposeAzBlobListCmd builds the Azure storage blob list command

func CountFilesOnAzureBlobStorage

func CountFilesOnAzureBlobStorage(
	configuration AzureConfiguration,
	clusterName,
	path string,
) (int, error)

CountFilesOnAzureBlobStorage counts files on Azure Blob storage

func CountFilesOnAzuriteBlobStorage

func CountFilesOnAzuriteBlobStorage(
	namespace,
	clusterName,
	path string,
) (int, error)

CountFilesOnAzuriteBlobStorage counts files on Azure Blob storage. using Azurite

func Create

func Create(
	ctx context.Context,
	crudClient client.Client,
	targetBackup apiv1.Backup,
) (*apiv1.Backup, error)

Create creates a Backup resource for a given cluster name

func CreateCertificateSecretsOnAzurite

func CreateCertificateSecretsOnAzurite(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	clusterName,
	azuriteCaSecName,
	azuriteTLSSecName string,
) error

CreateCertificateSecretsOnAzurite will create secrets for Azurite deployment

func CreateClusterFromBackupUsingPITR

func CreateClusterFromBackupUsingPITR(
	ctx context.Context,
	crudClient client.Client,
	scheme *runtime.Scheme,
	namespace,
	clusterName,
	backupFilePath,
	targetTime string,
) (*apiv1.Cluster, error)

CreateClusterFromBackupUsingPITR creates a cluster from backup, using the PITR

func CreateClusterFromExternalClusterBackupWithPITROnAzure

func CreateClusterFromExternalClusterBackupWithPITROnAzure(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	externalClusterName,
	sourceClusterName,
	targetTime,
	storageCredentialsSecretName,
	azStorageAccount,
	azBlobContainer string,
) (*v1.Cluster, error)

CreateClusterFromExternalClusterBackupWithPITROnAzure creates a cluster on Azure, starting from an external cluster backup with PITR

func CreateClusterFromExternalClusterBackupWithPITROnAzurite

func CreateClusterFromExternalClusterBackupWithPITROnAzurite(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	externalClusterName,
	sourceClusterName,
	targetTime string,
) (*v1.Cluster, error)

CreateClusterFromExternalClusterBackupWithPITROnAzurite creates a cluster with Azurite, starting from an external cluster backup with PITR

func CreateClusterFromExternalClusterBackupWithPITROnMinio

func CreateClusterFromExternalClusterBackupWithPITROnMinio(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	externalClusterName,
	sourceClusterName,
	targetTime string,
) (*apiv1.Cluster, error)

CreateClusterFromExternalClusterBackupWithPITROnMinio creates a cluster on Minio, starting from an external cluster backup with PITR

func CreateOnDemand

func CreateOnDemand(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	clusterName,
	backupName string,
	target apiv1.BackupTarget,
	method apiv1.BackupMethod,
) (*apiv1.Backup, error)

CreateOnDemand creates a Backup resource for a given cluster name Deprecated: Use Create. TODO: eradicate

func CreateOnDemandBackupViaKubectlPlugin

func CreateOnDemandBackupViaKubectlPlugin(
	namespace,
	clusterName,
	backupName string,
	target apiv1.BackupTarget,
	method apiv1.BackupMethod,
) error

CreateOnDemandBackupViaKubectlPlugin uses the kubectl plugin to create a backup

func CreateSASTokenCredentials

func CreateSASTokenCredentials(
	ctx context.Context,
	crudClient client.Client,
	namespace, id, key string,
) error

CreateSASTokenCredentials generates Secrets for the Azure Blob Storage

func CreateStorageCredentialsOnAzurite

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

CreateStorageCredentialsOnAzurite will create credentials for Azurite

func Execute

func Execute(
	ctx context.Context,
	crudClient client.Client,
	scheme *runtime.Scheme,
	namespace,
	backupFile string,
	onlyTargetStandbys bool,
	timeoutSeconds int,
) *apiv1.Backup

Execute performs a backup and checks the backup status

func GetConditionsInClusterStatus

func GetConditionsInClusterStatus(
	ctx context.Context,
	crudClient client.Client,
	namespace,
	clusterName string,
	conditionType apiv1.ClusterConditionType,
) (*v2.Condition, error)

GetConditionsInClusterStatus get conditions values as given type from cluster object status

func GetVolumeSnapshot

func GetVolumeSnapshot(
	ctx context.Context,
	crudClient client.Client,
	namespace, name string,
) (*v1.VolumeSnapshot, error)

GetVolumeSnapshot gets a VolumeSnapshot given name and namespace

func InstallAzCli

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

InstallAzCli will install Az cli

func InstallAzurite

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

InstallAzurite will set up Azurite in defined namespace and creates service

func List

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

List gathers the current list of backup in namespace

Types

type AzureConfiguration

type AzureConfiguration struct {
	StorageAccount string
	StorageKey     string
	BlobContainer  string
}

AzureConfiguration contains the variables needed to run the azure test environment correctly

func NewAzureConfigurationFromEnv

func NewAzureConfigurationFromEnv() AzureConfiguration

NewAzureConfigurationFromEnv creates a new AzureConfiguration from the environment variables

Jump to

Keyboard shortcuts

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