volumehelper

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVolumeHelperWithCache

func NewVolumeHelperWithCache(
	backup velerov1api.Backup,
	client crclient.Client,
	logger logrus.FieldLogger,
	pvcPodCache *podvolumeutil.PVCPodCache,
	pvcMustInclusionTracker vhutil.PVCMustInclusionTracker,
) (vhutil.VolumeHelper, error)

NewVolumeHelperWithCache creates a VolumeHelper using an externally managed PVC-to-Pod cache. This is used by plugins that build the cache lazily per-namespace (following the pattern from PR #9226). The cache can be nil, in which case PVC-to-Pod lookups will fall back to direct API calls.

func NewVolumeHelperWithNamespaces

func NewVolumeHelperWithNamespaces(
	volumePolicy *resourcepolicies.Policies,
	snapshotVolumes *bool,
	logger logrus.FieldLogger,
	client crclient.Client,
	defaultVolumesToFSBackup bool,
	backupExcludePVC bool,
	namespaces []string,
	pvcMustInclusionTracker vhutil.PVCMustInclusionTracker,
) (vhutil.VolumeHelper, error)

NewVolumeHelperWithNamespaces creates a VolumeHelper with a PVC-to-Pod cache for improved performance. The cache is built internally from the provided namespaces list. This avoids O(N*M) complexity when there are many PVCs and pods. See issue #9179 for details. Returns an error if cache building fails - callers should not proceed with backup in this case.

func ShouldPerformSnapshotWithBackup deprecated

func ShouldPerformSnapshotWithBackup(
	unstructured runtime.Unstructured,
	groupResource schema.GroupResource,
	backup velerov1api.Backup,
	crClient crclient.Client,
	logger logrus.FieldLogger,
) (bool, error)

ShouldPerformSnapshotWithBackup is used for third-party plugins. It supports to check whether the PVC or PodVolume should be backed up on demand. On the other hand, the volumeHelperImpl assume there is a VolumeHelper instance initialized before calling the ShouldPerformXXX functions.

Deprecated: Use ShouldPerformSnapshotWithVolumeHelper instead for better performance. ShouldPerformSnapshotWithVolumeHelper allows passing a pre-created VolumeHelper with an internal PVC-to-Pod cache, which avoids O(N*M) complexity when there are many PVCs and pods. See issue #9179 for details.

func ShouldPerformSnapshotWithVolumeHelper

func ShouldPerformSnapshotWithVolumeHelper(
	unstructured runtime.Unstructured,
	groupResource schema.GroupResource,
	backup velerov1api.Backup,
	crClient crclient.Client,
	logger logrus.FieldLogger,
	vh vhutil.VolumeHelper,
) (bool, error)

ShouldPerformSnapshotWithVolumeHelper is like ShouldPerformSnapshotWithBackup but accepts an optional VolumeHelper. If vh is non-nil, it will be used directly, avoiding the overhead of creating a new VolumeHelper on each call. This is useful for BIA plugins that process multiple PVCs during a single backup and want to reuse the same VolumeHelper (with its internal cache) across calls.

Types

This section is empty.

Jump to

Keyboard shortcuts

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