podvolume

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 35 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPvbRepositoryType

func GetPvbRepositoryType(pvb *velerov1api.PodVolumeBackup) string

GetPvbRepositoryType returns the repositoryType according to the PVB information

func GetPvrRepositoryType

func GetPvrRepositoryType(pvr *velerov1api.PodVolumeRestore) string

GetPvrRepositoryType returns the repositoryType according to the PVR information

func GetRealSource added in v1.17.0

func GetRealSource(pvb *velerov1api.PodVolumeBackup) string

func GetSnapshotIdentifier

func GetSnapshotIdentifier(podVolumeBackups *velerov1api.PodVolumeBackupList) map[string][]repotypes.SnapshotIdentifier

GetSnapshotIdentifier returns the snapshots represented by SnapshotIdentifier for the given PVBs

func GetVolumeBackupsForPod

func GetVolumeBackupsForPod(podVolumeBackups []*velerov1api.PodVolumeBackup, pod *corev1api.Pod, sourcePodNs string) map[string]string

GetVolumeBackupsForPod returns a map, of volume name -> snapshot id, of the PodVolumeBackups that exist for the provided pod.

Types

type BackupMicroService added in v1.17.0

type BackupMicroService struct {
	// contains filtered or unexported fields
}

BackupMicroService process data mover backups inside the backup pod

func NewBackupMicroService added in v1.17.0

func NewBackupMicroService(ctx context.Context, client client.Client, kubeClient kubernetes.Interface, pvbName string, namespace string, nodeName string,
	sourceTargetPath datapath.AccessPoint, dataPathMgr *datapath.Manager, repoEnsurer *repository.Ensurer, cred *credentials.CredentialGetter,
	pvbInformer cache.Informer, log logrus.FieldLogger) *BackupMicroService

func (*BackupMicroService) Init added in v1.17.0

func (r *BackupMicroService) Init() error

func (*BackupMicroService) OnDataPathCancelled added in v1.17.0

func (r *BackupMicroService) OnDataPathCancelled(ctx context.Context, namespace string, pvbName string)

func (*BackupMicroService) OnDataPathCompleted added in v1.17.0

func (r *BackupMicroService) OnDataPathCompleted(ctx context.Context, namespace string, pvbName string, result datapath.Result)

func (*BackupMicroService) OnDataPathFailed added in v1.17.0

func (r *BackupMicroService) OnDataPathFailed(ctx context.Context, namespace string, pvbName string, err error)

func (*BackupMicroService) OnDataPathProgress added in v1.17.0

func (r *BackupMicroService) OnDataPathProgress(ctx context.Context, namespace string, pvbName string, progress *uploader.Progress)

func (*BackupMicroService) RunCancelableDataPath added in v1.17.0

func (r *BackupMicroService) RunCancelableDataPath(ctx context.Context) (string, error)

func (*BackupMicroService) Shutdown added in v1.17.0

func (r *BackupMicroService) Shutdown()

type Backupper

type Backupper interface {
	// BackupPodVolumes backs up all specified volumes in a pod.
	BackupPodVolumes(backup *velerov1api.Backup, pod *corev1api.Pod, volumesToBackup []string, resPolicies *resourcepolicies.Policies, log logrus.FieldLogger) ([]*velerov1api.PodVolumeBackup, *PVCBackupSummary, []error)
	WaitAllPodVolumesProcessed(log logrus.FieldLogger) []*velerov1api.PodVolumeBackup
	GetPodVolumeBackupByPodAndVolume(podNamespace, podName, volume string) (*velerov1api.PodVolumeBackup, error)
	ListPodVolumeBackupsByPod(podNamespace, podName string) ([]*velerov1api.PodVolumeBackup, error)
}

Backupper can execute pod volume backups of volumes in a pod.

type BackupperFactory

type BackupperFactory interface {
	// NewBackupper returns a pod volumes backupper for use during a single Velero backup.
	NewBackupper(context.Context, logrus.FieldLogger, *velerov1api.Backup, string) (Backupper, error)
}

BackupperFactory can construct pod volumes backuppers.

func NewBackupperFactory

func NewBackupperFactory(
	repoLocker *repository.RepoLocker,
	repoEnsurer *repository.Ensurer,
	crClient ctrlclient.Client,
	pvbInformer ctrlcache.Informer,
	log logrus.FieldLogger,
) BackupperFactory

type PVCBackupSummary added in v1.12.0

type PVCBackupSummary struct {
	Backedup map[string]*corev1api.PersistentVolumeClaim
	Skipped  map[string]*skippedPVC
	// contains filtered or unexported fields
}

PVCBackupSummary is a summary for which PVCs are skipped, which are backed up after each execution of the Backupper The scope should be within one pod, so the volume name is the key for the maps

func NewPVCBackupSummary added in v1.12.0

func NewPVCBackupSummary() *PVCBackupSummary

type RestoreData

type RestoreData struct {
	Restore                         *velerov1api.Restore
	Pod                             *corev1api.Pod
	PodVolumeBackups                []*velerov1api.PodVolumeBackup
	SourceNamespace, BackupLocation string
}

type RestoreMicroService added in v1.17.0

type RestoreMicroService struct {
	// contains filtered or unexported fields
}

RestoreMicroService process data mover restores inside the restore pod

func NewRestoreMicroService added in v1.17.0

func NewRestoreMicroService(ctx context.Context, client client.Client, kubeClient kubernetes.Interface, pvrName string, namespace string, nodeName string,
	sourceTargetPath datapath.AccessPoint, dataPathMgr *datapath.Manager, repoEnsurer *repository.Ensurer, cred *credentials.CredentialGetter,
	pvrInformer cache.Informer, cacheDir string, log logrus.FieldLogger) *RestoreMicroService

func (*RestoreMicroService) Init added in v1.17.0

func (r *RestoreMicroService) Init() error

func (*RestoreMicroService) OnPvrCancelled added in v1.17.0

func (r *RestoreMicroService) OnPvrCancelled(ctx context.Context, namespace string, pvrName string)

func (*RestoreMicroService) OnPvrCompleted added in v1.17.0

func (r *RestoreMicroService) OnPvrCompleted(ctx context.Context, namespace string, pvrName string, result datapath.Result)

func (*RestoreMicroService) OnPvrFailed added in v1.17.0

func (r *RestoreMicroService) OnPvrFailed(ctx context.Context, namespace string, pvrName string, err error)

func (*RestoreMicroService) OnPvrProgress added in v1.17.0

func (r *RestoreMicroService) OnPvrProgress(ctx context.Context, namespace string, pvrName string, progress *uploader.Progress)

func (*RestoreMicroService) RunCancelableDataPath added in v1.17.0

func (r *RestoreMicroService) RunCancelableDataPath(ctx context.Context) (string, error)

func (*RestoreMicroService) Shutdown added in v1.17.0

func (r *RestoreMicroService) Shutdown()

type Restorer

type Restorer interface {
	// RestorePodVolumes restores all annotated volumes in a pod.
	RestorePodVolumes(RestoreData, *volume.RestoreVolumeInfoTracker) []error
}

Restorer can execute pod volume restores of volumes in a pod.

type RestorerFactory

type RestorerFactory interface {
	// NewRestorer returns a pod volumes restorer for use during a single Velero restore.
	NewRestorer(context.Context, *velerov1api.Restore) (Restorer, error)
}

RestorerFactory can construct pod volumes restorers.

func NewRestorerFactory

func NewRestorerFactory(repoLocker *repository.RepoLocker,
	repoEnsurer *repository.Ensurer,
	kubeClient kubernetes.Interface,
	crClient ctrlclient.Client,
	pvrInformer ctrlcache.Informer,
	log logrus.FieldLogger) RestorerFactory

type Tracker added in v1.14.0

type Tracker struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

Tracker keeps track of persistent volume claims that have been handled via pod volume backup.

func NewTracker added in v1.14.0

func NewTracker() *Tracker

func (*Tracker) Has added in v1.14.0

func (t *Tracker) Has(namespace, name string) bool

Has returns true if the PVC with the specified namespace and name has been tracked.

func (*Tracker) OptedoutByPod added in v1.14.0

func (t *Tracker) OptedoutByPod(namespace, name string) (bool, string)

OptedoutByPod returns true if the PVC with the specified namespace and name has been opted out by the pod. The second return value is the name of the pod which has the annotation that opted out the volume/pvc

func (*Tracker) Optout added in v1.14.0

func (t *Tracker) Optout(pod *corev1api.Pod, volumeName string)

Optout indicates a volume from a pod has been opted out by pod's annotation

func (*Tracker) Take added in v1.14.0

func (t *Tracker) Take(pod *corev1api.Pod, volumeName string)

Take indicates a volume from a pod has been taken by pod volume backup.

func (*Tracker) TakenForPodVolume added in v1.14.0

func (t *Tracker) TakenForPodVolume(pod *corev1api.Pod, volume string) (bool, string)

TakenForPodVolume returns true and the PVC's name if the pod volume with the specified name uses a PVC and that PVC has been taken by pod volume backup.

func (*Tracker) Track added in v1.14.0

func (t *Tracker) Track(pod *corev1api.Pod, volumeName string)

Track indicates a volume from a pod should be snapshotted by pod volume backup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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