Documentation
¶
Index ¶
- func GenerateBackupName(hcName, hcNamespace string) string
- func GenerateResourcePolicyConfigMap(name, namespace string) *unstructured.Unstructured
- func GenerateResourcePolicyName(hcName, hcNamespace string) string
- func GenerateRestoreName(hcName, hcNamespace string) string
- func GenerateScheduleName(hcName, hcNamespace string) string
- func NewCreateBackupCommand() *cobra.Command
- func NewCreateRestoreCommand() *cobra.Command
- func NewCreateScheduleCommand() *cobra.Command
- type CreateOptions
- func (o *CreateOptions) GenerateBackupObject(platform string) (*unstructured.Unstructured, *unstructured.Unstructured, error)
- func (o *CreateOptions) GenerateRestoreObject() (*unstructured.Unstructured, string, error)
- func (o *CreateOptions) GenerateScheduleObject(platform string) (*unstructured.Unstructured, *unstructured.Unstructured, error)
- func (o *CreateOptions) RunBackup(ctx context.Context) error
- func (o *CreateOptions) RunRestore(ctx context.Context) error
- func (o *CreateOptions) RunSchedule(ctx context.Context) error
- func (o *CreateOptions) ValidateBackupName() error
- func (o *CreateOptions) ValidateRestoreName() error
- func (o *CreateOptions) ValidateScheduleName() error
- func (o *CreateOptions) ValidateSchedulePace() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateBackupName ¶ added in v0.1.75
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
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
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
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 NewCreateRestoreCommand ¶
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) 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