Documentation ¶
Index ¶
- Constants
- func ConstructEndpoint(target *settings.BackupTarget) string
- func GetVMBackupError(vmBackup *harvesterv1.VirtualMachineBackup) *harvesterv1.Error
- func IsBackupProgressing(backup *harvesterv1.VirtualMachineBackup) bool
- func IsBackupReady(backup *harvesterv1.VirtualMachineBackup) bool
- func IsBackupTargetSame(vmBackupTarget *harvesterv1.BackupTarget, target *settings.BackupTarget) bool
- func RegisterBackup(ctx context.Context, management *config.Management, opts config.Options) error
- func RegisterBackupMetadata(ctx context.Context, management *config.Management, opts config.Options) error
- func RegisterBackupTarget(ctx context.Context, management *config.Management, opts config.Options) error
- func RegisterRestore(ctx context.Context, management *config.Management, opts config.Options) error
- type Handler
- func (h *Handler) OnBackupChange(key string, vmBackup *harvesterv1.VirtualMachineBackup) (*harvesterv1.VirtualMachineBackup, error)
- func (h *Handler) OnBackupRemove(key string, vmBackup *harvesterv1.VirtualMachineBackup) (*harvesterv1.VirtualMachineBackup, error)
- func (h *Handler) OnLHBackupChanged(key string, lhBackup *lhv1beta2.Backup) (*lhv1beta2.Backup, error)
- type MetadataHandler
- type RestoreHandler
- func (h *RestoreHandler) PersistentVolumeClaimOnChange(key string, pvc *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error)
- func (h *RestoreHandler) RestoreOnChanged(key string, restore *harvesterv1.VirtualMachineRestore) (*harvesterv1.VirtualMachineRestore, error)
- func (h *RestoreHandler) RestoreOnRemove(key string, restore *harvesterv1.VirtualMachineRestore) (*harvesterv1.VirtualMachineRestore, error)
- func (h *RestoreHandler) VMOnChange(key string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
- type TargetHandler
- type VirtualMachineBackupMetadata
Constants ¶
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 RegisterBackup ¶
RegisterBackup register the vmBackup and volumeSnapshot controller
func RegisterBackupMetadata ¶ added in v1.0.0
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 ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) OnBackupChange ¶
func (h *Handler) OnBackupChange(key string, vmBackup *harvesterv1.VirtualMachineBackup) (*harvesterv1.VirtualMachineBackup, error)
OnBackupChange handles vm backup object on change and reconcile vm backup status
func (*Handler) OnBackupRemove ¶ added in v1.0.0
func (h *Handler) OnBackupRemove(key string, vmBackup *harvesterv1.VirtualMachineBackup) (*harvesterv1.VirtualMachineBackup, error)
OnBackupRemove remove remote vm backup metadata
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(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 ¶
func (h *RestoreHandler) RestoreOnChanged(key string, restore *harvesterv1.VirtualMachineRestore) (*harvesterv1.VirtualMachineRestore, error)
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
func (h *RestoreHandler) RestoreOnRemove(key string, restore *harvesterv1.VirtualMachineRestore) (*harvesterv1.VirtualMachineRestore, error)
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 ¶
func (h *RestoreHandler) VMOnChange(key string, vm *kubevirtv1.VirtualMachine) (*kubevirtv1.VirtualMachine, error)
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 ¶ 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"` }