backupcontroller

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
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

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) Reconcile

func (r *BackupJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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

type BackupReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

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) Reconcile added in v1.3.0

func (r *BackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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

type PlanReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PlanReconciler reconciles a Plan object

func (*PlanReconciler) Reconcile

func (r *PlanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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) Reconcile

func (r *RestoreJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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