Documentation ¶
Index ¶
- Constants
- func BuildBackupPath(backup *dpv1alpha1.Backup, pathPrefix string) string
- func BuildBackupWorkloadLabels(backup *dpv1alpha1.Backup) map[string]string
- func BuildDeleteBackupFilesJobKey(backup *dpv1alpha1.Backup) client.ObjectKey
- func GenerateBackupJobName(backup *dpv1alpha1.Backup, prefix string) string
- func GenerateCRNameByBackupSchedule(backupSchedule *dpv1alpha1.BackupSchedule, method string) string
- func GetActionSet(ctx context.Context, cli client.Client, namespace, name string) (*dpv1alpha1.ActionSet, error)
- func GetBackupPolicy(ctx context.Context, cli client.Client, namespace, name string) (*dpv1alpha1.BackupPolicy, error)
- func GetSchedulePolicyByMethod(backupSchedule *dpv1alpha1.BackupSchedule, method string) *dpv1alpha1.SchedulePolicy
- type Deleter
- type DeletionStatus
- type Request
- type Scheduler
Constants ¶
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.
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 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 ¶
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 ¶
BuildActions builds the actions for the backup.
func (*Request) GetBackupType ¶
type Scheduler ¶
type Scheduler struct { intctrlutil.RequestCtx Client client.Client Scheme *k8sruntime.Scheme BackupSchedule *dpv1alpha1.BackupSchedule BackupPolicy *dpv1alpha1.BackupPolicy }