csi

package
v0.0.0-...-1eaa894 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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupVolumeSnapshot

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

func DeleteVolumeSnapshot

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

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

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 DiagnoseVS

func DiagnoseVS(vs *snapshotv1api.VolumeSnapshot) string

func EnsureDeleteVS

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

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

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

func GetVolumeSnapshotClassForStorageClass

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

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

func GetVolumeSnapshotClassFromBackupAnnotationsForDriver

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

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

func GetVolumeSnapshotContentForVolumeSnapshot

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

GetVolumeSnapshotContentForVolumeSnapshot returns the VolumeSnapshotContent object associated with the VolumeSnapshot.

func IsVolumeSnapshotClassHasListerSecret

func IsVolumeSnapshotClassHasListerSecret(vc *snapshotv1api.VolumeSnapshotClass) bool

IsVolumeSnapshotClassHasListerSecret returns whether a volumesnapshotclass has a snapshotlister secret

func IsVolumeSnapshotContentHasDeleteSecret

func IsVolumeSnapshotContentHasDeleteSecret(vsc *snapshotv1api.VolumeSnapshotContent) bool

IsVolumeSnapshotContentHasDeleteSecret returns whether a volumesnapshotcontent has a deletesnapshot secret

func IsVolumeSnapshotExists

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

IsVolumeSnapshotExists returns whether a specific volumesnapshot object exists.

func RemoveVSCProtect

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

func RetainVSC

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

func SetVolumeSnapshotContentDeletionPolicy

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

func ShouldSkipAction

func ShouldSkipAction(actionName string) bool

func WaitUntilVSCHandleIsReady

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

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