restore

package
v0.0.0-...-87b4d77 Latest Latest
Warning

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

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

Documentation

Overview

Package restore provides restore management for OpenBao clusters. It handles restoring snapshots from object storage to an OpenBao cluster.

Index

Constants

View Source
const (
	// ReasonRestoreValidationStarted indicates restore validation has started.
	ReasonRestoreValidationStarted = "RestoreValidationStarted"

	// RestoreConfigurationConditionType reports whether operator-known restore
	// prerequisites such as auth references, storage credential references, and
	// hardened-profile egress requirements are satisfied.
	RestoreConfigurationConditionType = "RestoreConfigurationReady"

	// ReasonRestoreStarted indicates restore execution has started.
	ReasonRestoreStarted = "RestoreStarted"

	// ReasonRestoreIdentityConfiguration describes how the generated restore workload receives cloud identity.
	ReasonRestoreIdentityConfiguration = "RestoreIdentityConfiguration"

	// ReasonRestoreJobCreated indicates the restore Job was created successfully.
	ReasonRestoreJobCreated = "RestoreJobCreated"

	// ReasonRestoreFailed indicates the restore operation failed.
	ReasonRestoreFailed = "RestoreFailed"

	// ReasonRestoreCompleted indicates the restore operation completed successfully.
	ReasonRestoreCompleted = "RestoreCompleted"

	// ReasonRestoreSucceeded indicates the restore operation succeeded.
	ReasonRestoreSucceeded = "RestoreSucceeded"

	// ReasonAuthRequired indicates authentication was not configured for restore.
	ReasonAuthRequired = constants.ReasonAuthenticationRequired

	// ReasonOperationLockBlocked indicates restore is waiting for another operation to release the cluster lock.
	ReasonOperationLockBlocked = constants.ReasonOperationLockBlocked

	// ReasonOperationLockLost indicates restore lost the cluster lock while running.
	ReasonOperationLockLost = "OperationLockLost"

	// ReasonOperationLockOverride indicates a force override cleared an existing operation lock.
	ReasonOperationLockOverride = "OperationLockOverride"

	// ComponentRestore is the component name for restore resources.
	ComponentRestore = "restore"
)

Reason constants for OpenBaoRestore conditions.

View Source
const (
	// RestoreJobNamePrefix is the prefix for restore job names.
	RestoreJobNamePrefix = constants.PrefixRestoreJob
	// RestoreJobTTLSeconds is the TTL for completed/failed restore jobs.
	RestoreJobTTLSeconds = 3600 // 1 hour
	// RestoreServiceAccountSuffix is appended to cluster name for the restore SA.
	RestoreServiceAccountSuffix = constants.SuffixRestoreServiceAccount
	// RestoreConditionType is the condition type for restore operations.
	RestoreConditionType = constants.RestoreConditionType // This will need to be added to conditions.go if missed

)

Variables

This section is empty.

Functions

func EnsureRestoreRBAC

func EnsureRestoreRBAC(ctx context.Context, c client.Client, scheme *runtime.Scheme, cluster *openbaov1alpha1.OpenBaoCluster) error

EnsureRestoreRBAC creates or updates Role/RoleBinding required by restore Jobs for pod discovery.

func EnsureRestoreServiceAccount

func EnsureRestoreServiceAccount(
	ctx context.Context,
	c client.Client,
	scheme *runtime.Scheme,
	cluster *openbaov1alpha1.OpenBaoCluster,
	target openbaov1alpha1.BackupTarget,
) error

EnsureRestoreServiceAccount creates or updates the ServiceAccount for restore Jobs.

Types

type Manager

type Manager struct {
	Platform string
	// contains filtered or unexported fields
}

Manager orchestrates restore operations for OpenBao clusters.

func NewManager

func NewManager(c client.Client, scheme *runtime.Scheme, recorder events.EventRecorder, operatorImageVerifier imageverify.Verifier, platform string) *Manager

NewManager creates a new restore Manager.

func (*Manager) Reconcile

func (m *Manager) Reconcile(ctx context.Context, logger logr.Logger, restore *openbaov1alpha1.OpenBaoRestore) (ctrl.Result, error)

Reconcile processes an OpenBaoRestore resource through its lifecycle. Returns (result, error) where result.RequeueAfter indicates if reconciliation should be rescheduled.

func (*Manager) WithReader

func (m *Manager) WithReader(reader client.Reader) *Manager

WithReader configures a live reader for lock/status read-before-write flows.

Jump to

Keyboard shortcuts

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