backup

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 40 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AWSAccessKey       = "AWS_ACCESS_KEY_ID"
	AWSSecretKey       = "AWS_SECRET_ACCESS_KEY"
	AWSEndpoints       = "AWS_ENDPOINTS"
	AWSCERT            = "AWS_CERT"
	VirtualHostedStyle = "VIRTUAL_HOSTED_STYLE"
)

Variables

This section is empty.

Functions

func ConstructEndpoint added in v1.0.0

func ConstructEndpoint(target *settings.BackupTarget) string

func GetVMBackupError added in v1.0.1

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

func IsBackupProgressing added in v1.0.1

func IsBackupProgressing(backup *harvesterv1.VirtualMachineBackup) bool

func IsBackupReady added in v1.1.0

func IsBackupReady(backup *harvesterv1.VirtualMachineBackup) bool

func IsBackupTargetSame added in v1.0.0

func IsBackupTargetSame(vmBackupTarget *harvesterv1.BackupTarget, target *settings.BackupTarget) bool

func IsNewVMOrHasRetainPolicy added in v1.2.2

func IsNewVMOrHasRetainPolicy(vmRestore *harvesterv1.VirtualMachineRestore) bool

func RegisterBackup

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

RegisterBackup register the vmBackup and volumeSnapshot controller

func RegisterBackupMetadata added in v1.0.0

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 added in v1.0.0

OnBackupRemove remove remote vm backup metadata

func (*Handler) OnLHBackupChanged added in v1.0.0

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

type MetadataHandler added in v1.0.0

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

func (*MetadataHandler) OnBackupTargetChange added in v1.0.0

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

OnBackupTargetChange resync vm metadata files when backup target change

type RestoreHandler

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

func (*RestoreHandler) LHEngineOnChange added in v1.3.0

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 added in v1.0.1

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 *harvesterv1.Setting) (*harvesterv1.Setting, error)

OnBackupTargetChange handles backupTarget setting object on change

type VirtualMachineBackupMetadata added in v1.0.0

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

Jump to

Keyboard shortcuts

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