Documentation
¶
Index ¶
Constants ¶
const ( // DefaultApplicationAPIGroup is the default API group for applications // when not specified in ApplicationRef or ApplicationSelector. // Deprecated: Use backupsv1alpha1.DefaultApplicationAPIGroup instead. DefaultApplicationAPIGroup = backupsv1alpha1.DefaultApplicationAPIGroup )
Variables ¶
This section is empty.
Functions ¶
func NormalizeApplicationRef ¶
func NormalizeApplicationRef(ref corev1.TypedLocalObjectReference) corev1.TypedLocalObjectReference
NormalizeApplicationRef sets the default apiGroup to DefaultApplicationAPIGroup if it's not specified. Deprecated: Use backupsv1alpha1.NormalizeApplicationRef instead.
Types ¶
type BackupJobReconciler ¶
type BackupJobReconciler struct {
client.Client
dynamic.Interface
meta.RESTMapper
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
BackupJobReconciler reconciles BackupJob with a strategy from the strategy.backups.cozystack.io API group.
func (*BackupJobReconciler) SetupWithManager ¶
func (r *BackupJobReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers our controller with the Manager and sets up watches.
type BackupReconciler ¶ added in v1.3.0
BackupReconciler reconciles Backup objects. It manages a finalizer that ensures the underlying Velero backup is deleted when the cozystack Backup resource is deleted.
func (*BackupReconciler) SetupWithManager ¶ added in v1.3.0
func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the BackupReconciler with the Manager.
type CommonRestoreOptions ¶ added in v1.3.0
type CommonRestoreOptions struct {
// TargetNamespace is the namespace to restore into. When set (and differs
// from the backup namespace), a cross-namespace restore (copy) is performed
// using Velero's namespaceMapping.
TargetNamespace string `json:"targetNamespace,omitempty"`
// FailIfTargetExists makes the restore fail if the target resource already
// exists. Defaults to true when omitted.
FailIfTargetExists *bool `json:"failIfTargetExists,omitempty"`
}
CommonRestoreOptions contains driver-agnostic restore options shared across all application kinds.
func (*CommonRestoreOptions) GetFailIfTargetExists ¶ added in v1.3.0
func (o *CommonRestoreOptions) GetFailIfTargetExists() bool
GetFailIfTargetExists returns the effective value (default: true).
type PlanReconciler ¶
PlanReconciler reconciles a Plan object
func (*PlanReconciler) SetupWithManager ¶
func (r *PlanReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers our controller with the Manager and sets up watches.
type ResolvedBackupConfig ¶
type ResolvedBackupConfig struct {
StrategyRef corev1.TypedLocalObjectReference
Parameters map[string]string
}
ResolvedBackupConfig contains the resolved strategy and storage configuration from a BackupClass.
func ResolveBackupClass ¶
func ResolveBackupClass( ctx context.Context, c client.Client, backupClassName string, applicationRef corev1.TypedLocalObjectReference, ) (*ResolvedBackupConfig, error)
ResolveBackupClass resolves a BackupClass and finds the matching strategy for the given application. It normalizes the applicationRef's apiGroup (defaults to apps.cozystack.io if not specified) and matches it against the strategies in the BackupClass.
type RestoreJobReconciler ¶
type RestoreJobReconciler struct {
client.Client
dynamic.Interface
meta.RESTMapper
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
RestoreJobReconciler reconciles RestoreJob objects. It routes RestoreJobs to strategy-specific handlers based on the strategy referenced in the Backup that the RestoreJob is restoring from.
func (*RestoreJobReconciler) SetupWithManager ¶
func (r *RestoreJobReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers our controller with the Manager and sets up watches.
type RestoreOptions ¶ added in v1.3.0
type RestoreOptions struct {
CommonRestoreOptions `json:",inline"`
// KeepOriginalPVC renames the original PVC to <name>-orig-<hash> before restore.
// Only effective for in-place VMInstance restore (no targetNamespace). Defaults to true when omitted.
KeepOriginalPVC *bool `json:"keepOriginalPVC,omitempty"`
// KeepOriginalIpAndMac preserves the original IP and MAC address via OVN
// annotations. Only effective for VMInstance restores. Defaults to true when omitted.
KeepOriginalIpAndMac *bool `json:"keepOriginalIpAndMac,omitempty"`
}
RestoreOptions is the typed representation of RestoreJob.Spec.Options for the Velero driver. The struct is deserialized from runtime.RawExtension and used for all application kinds. VMInstance-specific fields (KeepOriginalPVC, KeepOriginalIpAndMac) are only effective when the application kind is VMInstance.
func (*RestoreOptions) GetKeepOriginalIpAndMac ¶ added in v1.3.0
func (o *RestoreOptions) GetKeepOriginalIpAndMac() bool
GetKeepOriginalIpAndMac returns the effective value (default: true).
func (*RestoreOptions) GetKeepOriginalPVC ¶ added in v1.3.0
func (o *RestoreOptions) GetKeepOriginalPVC() bool
GetKeepOriginalPVC returns the effective value (default: true).