csi

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupVolumeSnapshot added in v1.14.0

func CleanupVolumeSnapshot(
	volSnap *snapshotv1api.VolumeSnapshot,
	crClient crclient.Client,
	log logrus.FieldLogger,
)

func DeleteVolumeSnapshot added in v1.14.0

func DeleteVolumeSnapshot(
	vs snapshotv1api.VolumeSnapshot,
	vsc snapshotv1api.VolumeSnapshotContent,
	backup *velerov1api.Backup,
	client crclient.Client,
	logger logrus.FieldLogger,
)

DeleteVolumeSnapshot handles the VolumeSnapshot instance deletion.

func DeleteVolumeSnapshotContentIfAny added in v1.12.0

func DeleteVolumeSnapshotContentIfAny(
	ctx context.Context,
	snapshotClient snapshotter.SnapshotV1Interface,
	vscName string, log logrus.FieldLogger,
)

DeleteVolumeSnapshotContentIfAny deletes a VSC by name if it exists, and log an error when the deletion fails.

func DeleteVolumeSnapshotIfAny added in v1.12.0

func DeleteVolumeSnapshotIfAny(
	ctx context.Context,
	snapshotClient snapshotter.SnapshotV1Interface,
	vsName string,
	vsNamespace string,
	log logrus.FieldLogger,
)

DeleteVolumeSnapshotIfAny deletes a VS by name if it exists, and log an error when the deletion fails

func EnsureDeleteVS added in v1.12.0

func EnsureDeleteVS(ctx context.Context, snapshotClient snapshotter.SnapshotV1Interface,
	vsName string, vsNamespace string, timeout time.Duration) error

EnsureDeleteVS asserts the existence of a VS by name, deletes it and waits for its disappearance and returns errors on any failure.

func EnsureDeleteVSC added in v1.12.0

func EnsureDeleteVSC(ctx context.Context, snapshotClient snapshotter.SnapshotV1Interface,
	vscName string, timeout time.Duration) error

EnsureDeleteVSC asserts the existence of a VSC by name, deletes it and waits for its disappearance and returns errors on any failure.

func GetVolumeSnapshotClass added in v1.14.0

func GetVolumeSnapshotClass(
	provisioner string,
	backup *velerov1api.Backup,
	pvc *corev1api.PersistentVolumeClaim,
	log logrus.FieldLogger,
	crClient crclient.Client,
) (*snapshotv1api.VolumeSnapshotClass, error)

func GetVolumeSnapshotClassForStorageClass added in v1.14.0

func GetVolumeSnapshotClassForStorageClass(
	provisioner string,
	snapshotClasses *snapshotv1api.VolumeSnapshotClassList,
) (*snapshotv1api.VolumeSnapshotClass, error)

GetVolumeSnapshotClassForStorageClass returns a VolumeSnapshotClass for the supplied volume provisioner/ driver name.

func GetVolumeSnapshotClassFromBackupAnnotationsForDriver added in v1.14.0

func GetVolumeSnapshotClassFromBackupAnnotationsForDriver(
	backup *velerov1api.Backup,
	provisioner string,
	snapshotClasses *snapshotv1api.VolumeSnapshotClassList,
) (*snapshotv1api.VolumeSnapshotClass, error)

GetVolumeSnapshotClassFromAnnotationsForDriver returns a VolumeSnapshotClass for the supplied volume provisioner/driver name from the annotation of the backup.

func GetVolumeSnapshotClassFromPVCAnnotationsForDriver added in v1.14.0

func GetVolumeSnapshotClassFromPVCAnnotationsForDriver(
	pvc *corev1api.PersistentVolumeClaim,
	provisioner string,
	snapshotClasses *snapshotv1api.VolumeSnapshotClassList,
) (*snapshotv1api.VolumeSnapshotClass, error)

func GetVolumeSnapshotContentForVolumeSnapshot added in v1.12.0

func GetVolumeSnapshotContentForVolumeSnapshot(
	volSnap *snapshotv1api.VolumeSnapshot,
	snapshotClient snapshotter.SnapshotV1Interface,
) (*snapshotv1api.VolumeSnapshotContent, error)

GetVolumeSnapshotContentForVolumeSnapshot returns the VolumeSnapshotContent object associated with the VolumeSnapshot.

func IsVolumeSnapshotClassHasListerSecret added in v1.14.0

func IsVolumeSnapshotClassHasListerSecret(vc *snapshotv1api.VolumeSnapshotClass) bool

IsVolumeSnapshotClassHasListerSecret returns whether a volumesnapshotclass has a snapshotlister secret

func IsVolumeSnapshotContentHasDeleteSecret added in v1.14.0

func IsVolumeSnapshotContentHasDeleteSecret(vsc *snapshotv1api.VolumeSnapshotContent) bool

IsVolumeSnapshotContentHasDeleteSecret returns whether a volumesnapshotcontent has a deletesnapshot secret

func IsVolumeSnapshotExists added in v1.14.0

func IsVolumeSnapshotExists(
	ns,
	name string,
	crClient crclient.Client,
) bool

IsVolumeSnapshotExists returns whether a specific volumesnapshot object exists.

func RemoveVSCProtect added in v1.12.2

func RemoveVSCProtect(ctx context.Context, snapshotClient snapshotter.SnapshotV1Interface, vscName string, timeout time.Duration) error

func RetainVSC added in v1.12.0

RetainVSC updates the VSC's deletion policy to Retain and then return the update VSC

func SetVolumeSnapshotContentDeletionPolicy added in v1.14.0

func SetVolumeSnapshotContentDeletionPolicy(
	vscName string,
	crClient crclient.Client,
) error

func ShouldSkipAction added in v1.13.0

func ShouldSkipAction(actionName string) bool

func WaitUntilVSCHandleIsReady added in v1.14.0

func WaitUntilVSCHandleIsReady(
	volSnap *snapshotv1api.VolumeSnapshot,
	crClient crclient.Client,
	log logrus.FieldLogger,
	shouldWait bool,
	csiSnapshotTimeout time.Duration,
) (*snapshotv1api.VolumeSnapshotContent, error)

WaitUntilVSCHandleIsReady returns the VolumeSnapshotContent object associated with the volumesnapshot

func WaitVolumeSnapshotReady added in v1.12.0

func WaitVolumeSnapshotReady(
	ctx context.Context,
	snapshotClient snapshotter.SnapshotV1Interface,
	volumeSnapshot string,
	volumeSnapshotNS string,
	timeout time.Duration,
	log logrus.FieldLogger,
) (*snapshotv1api.VolumeSnapshot, error)

WaitVolumeSnapshotReady waits a VS to become ready to use until the timeout reaches

Types

This section is empty.

Jump to

Keyboard shortcuts

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