backup

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVMBackupError

func GetVMBackupError(vmBackup *cloudweavv1.VirtualMachineBackup) *cloudweavv1.Error

func IsBackupProgressing

func IsBackupProgressing(backup *cloudweavv1.VirtualMachineBackup) bool

func IsBackupReady

func IsBackupReady(backup *cloudweavv1.VirtualMachineBackup) bool

func IsNewVMOrHasRetainPolicy

func IsNewVMOrHasRetainPolicy(vmRestore *cloudweavv1.VirtualMachineRestore) bool

func RegisterBackup

func RegisterBackup(ctx context.Context, management *config.Management, _ config.Options) error

RegisterBackup register the vmBackup and volumeSnapshot controller

func RegisterBackupBackingImage added in v1.4.0

func RegisterBackupBackingImage(ctx context.Context, management *config.Management, _ config.Options) error

RegisterBackupBackingImage register the backup backing image controller and resync vmimage metadata when backup backing image is completed

func RegisterBackupMetadata

func RegisterBackupMetadata(ctx context.Context, management *config.Management, _ config.Options) error

RegisterBackupMetadata register the setting controller and resync vm backup metadata when backup target change

func RegisterBackupTarget

func RegisterBackupTarget(ctx context.Context, management *config.Management, _ config.Options) error

RegisterBackupTarget register the setting controller and reconsile longhorn setting when backup target changed

func RegisterRestore

func RegisterRestore(ctx context.Context, management *config.Management, _ config.Options) error

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) OnBackupChange

OnBackupChange handles vm backup object on change and reconcile vm backup status

func (*Handler) OnBackupRemove

OnBackupRemove remove remote vm backup metadata

func (*Handler) OnLHBackupChanged

func (h *Handler) OnLHBackupChanged(_ string, lhBackup *lhv1beta2.Backup) (*lhv1beta2.Backup, error)

type MetadataHandler

type MetadataHandler struct {
	// contains filtered or unexported fields
}

func (*MetadataHandler) OnBackupTargetChange

func (h *MetadataHandler) OnBackupTargetChange(_ string, setting *cloudweavv1.Setting) (*cloudweavv1.Setting, error)

OnBackupTargetChange resync vm metadata files when backup target change

type RestoreHandler

type RestoreHandler struct {
	// contains filtered or unexported fields
}

func (*RestoreHandler) LHEngineOnChange

func (h *RestoreHandler) LHEngineOnChange(_ string, lhEngine *lhv1beta2.Engine) (*lhv1beta2.Engine, error)

func (*RestoreHandler) PersistentVolumeClaimOnChange

func (h *RestoreHandler) PersistentVolumeClaimOnChange(_ string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)

PersistentVolumeClaimOnChange watching the PVCs on change and enqueue the vmRestore if it has the restore annotation

func (*RestoreHandler) RestoreOnChanged

RestoreOnChanged handles vmRestore CRD object on change, it will help to create the new PVCs and either replace them with existing VM or used for the new VM.

func (*RestoreHandler) RestoreOnRemove

RestoreOnRemove delete VolumeSnapshotContent which is created by restore controller Since we would like to prevent LH Backups from being removed when users delete the VM, we use Retain policy in VolumeSnapshotContent. We need to delete VolumeSnapshotContent by restore controller, or there will have remaining VolumeSnapshotContent in the system.

func (*RestoreHandler) VMOnChange

VMOnChange watching the VM on change and enqueue the vmRestore if it has the restore annotation

type TargetHandler

type TargetHandler struct {
	// contains filtered or unexported fields
}

func (*TargetHandler) OnBackupTargetChange

func (h *TargetHandler) OnBackupTargetChange(_ string, setting *cloudweavv1.Setting) (*cloudweavv1.Setting, error)

OnBackupTargetChange handles backupTarget setting object on change

type VirtualMachineBackupMetadata

type VirtualMachineBackupMetadata struct {
	Name          string                                `json:"name"`
	Namespace     string                                `json:"namespace"`
	BackupSpec    cloudweavv1.VirtualMachineBackupSpec  `json:"backupSpec,omitempty"`
	VMSourceSpec  *cloudweavv1.VirtualMachineSourceSpec `json:"vmSourceSpec,omitempty"`
	VolumeBackups []cloudweavv1.VolumeBackup            `json:"volumeBackups,omitempty"`
	SecretBackups []cloudweavv1.SecretBackup            `json:"secretBackups,omitempty"`
}

type VirtualMachineImageMetadata added in v1.4.0

type VirtualMachineImageMetadata struct {
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	URL         string `json:"url"`
	DisplayName string `json:"displayName,omitempty"`
	Description string `json:"description,omitempty"`
	// Checksum is from the backup backing image status
	Checksum               string            `json:"checksum,omitempty"`
	StorageClassParameters map[string]string `json:"storageClassParameters,omitempty"`
}

Jump to

Keyboard shortcuts

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