oadp

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBackupName added in v0.1.75

func GenerateBackupName(hcName, hcNamespace string) string

GenerateBackupName creates a backup name using the format: {hcName}-{hcNamespace}-{randomSuffix}. If the name is too long, it uses utils.ShortenName to ensure it doesn't exceed 63 characters.

func GenerateResourcePolicyConfigMap added in v0.1.75

func GenerateResourcePolicyConfigMap(name, namespace string) *unstructured.Unstructured

GenerateResourcePolicyConfigMap creates a ConfigMap with a Velero volume policy that skips PVCs labeled with the KubeVirt RHCOS boot image label.

func GenerateResourcePolicyName added in v0.1.75

func GenerateResourcePolicyName(hcName, hcNamespace string) string

GenerateResourcePolicyName creates a deterministic resource policy ConfigMap name using the format: {hcName}-{hcNamespace}-{hashSuffix}. The suffix is derived from a SHA-256 hash of the inputs so the same HC always produces the same ConfigMap name, avoiding orphaned ConfigMaps on retries.

func GenerateRestoreName added in v0.1.75

func GenerateRestoreName(hcName, hcNamespace string) string

GenerateRestoreName creates a restore name using the format: {hcName}-{hcNamespace}-{randomSuffix} If the name is too long, it uses utils.ShortenName to ensure it doesn't exceed 63 characters

func GenerateScheduleName added in v0.1.75

func GenerateScheduleName(hcName, hcNamespace string) string

GenerateScheduleName creates a schedule name using the format: {hcName}-{hcNamespace}-{randomSuffix}. If the name is too long, it uses utils.ShortenName to ensure it doesn't exceed 63 characters.

func NewCreateBackupCommand

func NewCreateBackupCommand() *cobra.Command

func NewCreateRestoreCommand

func NewCreateRestoreCommand() *cobra.Command

func NewCreateScheduleCommand

func NewCreateScheduleCommand() *cobra.Command

Types

type CreateOptions

type CreateOptions struct {
	// Required flags (common)
	HCName      string
	HCNamespace string

	// Restore-specific required flags
	BackupName   string
	ScheduleName string

	// Schedule-specific required flags
	Schedule string

	// Optional flags with defaults (common)
	OADPNamespace string
	Render        bool

	// Backup-specific optional flags
	BackupCustomName         string
	StorageLocation          string
	TTL                      time.Duration
	SnapshotMoveData         bool
	DefaultVolumesToFsBackup bool
	IncludedResources        []string

	// Restore-specific optional flags
	RestoreName            string
	ExistingResourcePolicy string
	IncludeNamespaces      []string
	RestorePVs             *bool
	PreserveNodePorts      *bool

	// Schedule-specific optional flags
	Paused             bool
	UseOwnerReferences bool
	SkipImmediately    bool

	// Client context (common)
	Log    logr.Logger
	Client client.Client
}

CreateOptions contains all configuration for both backup and restore operations

func (*CreateOptions) GenerateBackupObject added in v0.1.75

func (o *CreateOptions) GenerateBackupObject(platform string) (*unstructured.Unstructured, *unstructured.Unstructured, error)

GenerateBackupObject generates a backup object and, for KubeVirt platform, also returns a resource policy ConfigMap that tells Velero to skip RHCOS boot image PVCs.

func (*CreateOptions) GenerateRestoreObject

func (o *CreateOptions) GenerateRestoreObject() (*unstructured.Unstructured, string, error)

func (*CreateOptions) GenerateScheduleObject

func (o *CreateOptions) GenerateScheduleObject(platform string) (*unstructured.Unstructured, *unstructured.Unstructured, error)

GenerateScheduleObject generates a schedule object and, for KubeVirt platform, also returns a resource policy ConfigMap that tells Velero to skip RHCOS boot image PVCs.

func (*CreateOptions) RunBackup

func (o *CreateOptions) RunBackup(ctx context.Context) error

func (*CreateOptions) RunRestore

func (o *CreateOptions) RunRestore(ctx context.Context) error

func (*CreateOptions) RunSchedule

func (o *CreateOptions) RunSchedule(ctx context.Context) error

func (*CreateOptions) ValidateBackupName

func (o *CreateOptions) ValidateBackupName() error

ValidateBackupName validates the custom backup name if provided

func (*CreateOptions) ValidateRestoreName

func (o *CreateOptions) ValidateRestoreName() error

ValidateRestoreName validates the custom restore name if provided

func (*CreateOptions) ValidateScheduleName

func (o *CreateOptions) ValidateScheduleName() error

ValidateScheduleName validates the custom schedule name if provided

func (*CreateOptions) ValidateSchedulePace

func (o *CreateOptions) ValidateSchedulePace() error

Jump to

Keyboard shortcuts

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