restore

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 57 Imported by: 20

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 added in v1.6.0

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 added in v0.9.0

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

type Priorities added in v1.9.3

type Priorities struct {
	HighPriorities []string
	LowPriorities  []string
}

Priorities defines the desired order of resource operations: Resources in the HighPriorities list will be handled first Resources in the LowPriorities list will be handled last Other resources will be handled alphabetically after the high prioritized resources and before the low prioritized resources

func (*Priorities) Set added in v1.9.3

func (p *Priorities) Set(s string) error

Set parses the provided string to the priority object

func (*Priorities) String added in v1.9.3

func (p *Priorities) String() string

String returns a string representation of Priority.

func (*Priorities) Type added in v1.9.3

func (p *Priorities) Type() string

Type specifies the flag type

type Request added in v1.0.1

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
	// contains filtered or unexported fields
}

func (*Request) GetItemOperationsList added in v1.11.0

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

GetItemOperationsList returns ItemOperationsList, initializing it if necessary

func (*Request) RestoredResourceList added in v1.11.0

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 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 added in v1.0.0

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