restore

package
v0.0.0-...-c1b1270 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemRestoreResultCreated = "created"
	ItemRestoreResultUpdated = "updated"
	ItemRestoreResultFailed  = "failed"
	ItemRestoreResultSkipped = "skipped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChosenGroupVersion

type ChosenGroupVersion struct {
	Group   string
	Version string
	Dir     string
}

ChosenGroupVersion is the API Group version that was selected to restore from potentially multiple backed up version enabled by the feature flag APIGroupVersionsFeatureFlag

type PVRestorer

type PVRestorer interface {
	// contains filtered or unexported methods
}

type Request

type Request struct {
	*velerov1api.Restore

	Log              logrus.FieldLogger
	Backup           *velerov1api.Backup
	PodVolumeBackups []*velerov1api.PodVolumeBackup
	VolumeSnapshots  []*volume.Snapshot
	BackupReader     io.Reader
	RestoredItems    map[itemKey]restoredItemStatus

	ResourceModifiers             *resourcemodifiers.ResourceModifiers
	DisableInformerCache          bool
	CSIVolumeSnapshots            []*snapshotv1api.VolumeSnapshot
	BackupVolumeInfoMap           map[string]volume.BackupVolumeInfo
	RestoreVolumeInfoTracker      *volume.RestoreVolumeInfoTracker
	ResourceDeletionStatusTracker kube.ResourceDeletionStatusTracker
	// contains filtered or unexported fields
}

func (*Request) GetItemOperationsList

func (r *Request) GetItemOperationsList() *[]*itemoperation.RestoreOperation

GetItemOperationsList returns ItemOperationsList, initializing it if necessary

func (*Request) RestoredResourceList

func (r *Request) RestoredResourceList() map[string][]string

RestoredResourceList returns the list of restored resources grouped by the API Version and Kind

type Restorer

type Restorer interface {
	// Restore restores the backup data from backupReader, returning warnings and errors.
	Restore(req *Request,
		actions []riav2.RestoreItemAction,
		volumeSnapshotterGetter VolumeSnapshotterGetter,
	) (results.Result, results.Result)
	RestoreWithResolvers(
		req *Request,
		restoreItemActionResolver framework.RestoreItemActionResolverV2,
		volumeSnapshotterGetter VolumeSnapshotterGetter,
	) (results.Result, results.Result)
}

Restorer knows how to restore a backup.

func NewKubernetesRestorer

func NewKubernetesRestorer(
	discoveryHelper discovery.Helper,
	dynamicFactory client.DynamicFactory,
	resourcePriorities types.Priorities,
	namespaceClient corev1.NamespaceInterface,
	podVolumeRestorerFactory podvolume.RestorerFactory,
	podVolumeTimeout time.Duration,
	resourceTerminatingTimeout time.Duration,
	resourceTimeout time.Duration,
	logger logrus.FieldLogger,
	podCommandExecutor podexec.PodCommandExecutor,
	podGetter cache.Getter,
	credentialStore credentials.FileStore,
	kbClient crclient.Client,
	multiHookTracker *hook.MultiHookTracker,
) (Restorer, error)

NewKubernetesRestorer creates a new kubernetesRestorer.

type VolumeSnapshotterGetter

type VolumeSnapshotterGetter interface {
	GetVolumeSnapshotter(name string) (vsv1.VolumeSnapshotter, error)
}

Directories

Path Synopsis
csi

Jump to

Keyboard shortcuts

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