backup

package
v0.8.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatVersion = "0.1.0"

	// RepoVolumeMountPath is the backup repo volume mount path.
	RepoVolumeMountPath = "/backupdata"
)

FormatVersion is the backup file format version, including major, minor, and patch version.

View Source
const (
	BackupDataJobNamePrefix = "dp-backup"
)

Variables

This section is empty.

Functions

func BuildBackupPath

func BuildBackupPath(backup *dpv1alpha1.Backup, pathPrefix string) string

BuildBackupPath builds the path to storage backup datas in backup repository.

func BuildBackupWorkloadLabels

func BuildBackupWorkloadLabels(backup *dpv1alpha1.Backup) map[string]string

BuildBackupWorkloadLabels builds the labels for workload which owned by backup.

func BuildDeleteBackupFilesJobKey

func BuildDeleteBackupFilesJobKey(backup *dpv1alpha1.Backup) client.ObjectKey

func GenerateBackupJobName

func GenerateBackupJobName(backup *dpv1alpha1.Backup, prefix string) string

func GenerateCRNameByBackupSchedule

func GenerateCRNameByBackupSchedule(backupSchedule *dpv1alpha1.BackupSchedule, method string) string

GenerateCRNameByBackupSchedule generate a CR name which is created by BackupSchedule, such as CronJob Backup.

func GetActionSet

func GetActionSet(ctx context.Context, cli client.Client, namespace, name string) (*dpv1alpha1.ActionSet, error)

func GetBackupPolicy

func GetBackupPolicy(ctx context.Context, cli client.Client, namespace, name string) (*dpv1alpha1.BackupPolicy, error)

GetBackupPolicy returns the BackupPolicy with the given namespace and name.

func GetSchedulePolicyByMethod

func GetSchedulePolicyByMethod(backupSchedule *dpv1alpha1.BackupSchedule, method string) *dpv1alpha1.SchedulePolicy

Types

type Deleter

type Deleter struct {
	ctrlutil.RequestCtx
	Client client.Client
	Scheme *runtime.Scheme
}

func (*Deleter) DeleteBackupFiles

func (d *Deleter) DeleteBackupFiles(backup *dpv1alpha1.Backup) (DeletionStatus, error)

DeleteBackupFiles builds a job to delete backup files, and returns the deletion status. If the deletion job exists, it will check the job status and return the corresponding deletion status.

func (*Deleter) DeleteVolumeSnapshots

func (d *Deleter) DeleteVolumeSnapshots(backup *dpv1alpha1.Backup) error

type DeletionStatus

type DeletionStatus string
const (
	DeletionStatusDeleting  DeletionStatus = "Deleting"
	DeletionStatusFailed    DeletionStatus = "Failed"
	DeletionStatusSucceeded DeletionStatus = "Succeeded"
	DeletionStatusUnknown   DeletionStatus = "Unknown"
)

type Request

type Request struct {
	*dpv1alpha1.Backup
	intctrlutil.RequestCtx

	Client           client.Client
	BackupPolicy     *dpv1alpha1.BackupPolicy
	BackupMethod     *dpv1alpha1.BackupMethod
	ActionSet        *dpv1alpha1.ActionSet
	TargetPods       []*corev1.Pod
	BackupRepoPVC    *corev1.PersistentVolumeClaim
	BackupRepo       *dpv1alpha1.BackupRepo
	ToolConfigSecret *corev1.Secret
}

Request is a request for a backup, with all references to other objects.

func (*Request) BuildActions

func (r *Request) BuildActions() ([]action.Action, error)

BuildActions builds the actions for the backup.

func (*Request) GetBackupType

func (r *Request) GetBackupType() string

type Scheduler

type Scheduler struct {
	intctrlutil.RequestCtx
	Client         client.Client
	Scheme         *k8sruntime.Scheme
	BackupSchedule *dpv1alpha1.BackupSchedule
	BackupPolicy   *dpv1alpha1.BackupPolicy
}

func (*Scheduler) Schedule

func (s *Scheduler) Schedule() error

Jump to

Keyboard shortcuts

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