backup

package
v0.0.2-pre Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

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

func ConstructEndpoint(target *settings.BackupTarget) string

func GetVMBackupError

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

func IsBackupProgressing

func IsBackupProgressing(backup *harvesterv1.VirtualMachineBackup) bool

func IsBackupTargetSame

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

func RegisterBackup

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

RegisterBackup register the vmBackup and volumeSnapshot controller

func RegisterBackupMetadata

func RegisterBackupMetadata(ctx context.Context, management *config.Management, opts 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, opts 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, opts 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(key string, lhBackup *lhv1beta1.Backup) (*lhv1beta1.Backup, error)

type MetadataHandler

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

func (*MetadataHandler) OnBackupTargetChange

func (h *MetadataHandler) OnBackupTargetChange(key 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) PersistentVolumeClaimOnChange

func (h *RestoreHandler) PersistentVolumeClaimOnChange(key 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(key string, setting *harvesterv1.Setting) (*harvesterv1.Setting, error)

OnBackupTargetChange handles backupTarget setting object on change

type VirtualMachineBackupMetadata

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