util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeSnapshotLabel              = "velero.io/volume-snapshot-name"
	VolumeSnapshotHandleAnnotation   = "velero.io/csi-volumesnapshot-handle"
	CSIDriverNameAnnotation          = "velero.io/csi-driver-name"
	CSIDeleteSnapshotSecretName      = "velero.io/csi-deletesnapshotsecret-name"
	CSIDeleteSnapshotSecretNamespace = "velero.io/csi-deletesnapshotsecret-namespace"
	CSIVSCDeletionPolicy             = "velero.io/csi-vsc-deletion-policy"

	// There is no release w/ these constants exported. Using the strings for now.
	// CSI Labels volumesnapshotclass
	// https://github.com/kubernetes-csi/external-snapshotter/blob/master/pkg/utils/util.go#L59-L60
	PrefixedSnapshotterListSecretNameKey      = "csi.storage.k8s.io/snapshotter-list-secret-name"
	PrefixedSnapshotterListSecretNamespaceKey = "csi.storage.k8s.io/snapshotter-list-secret-namespace"

	// CSI Labels volumesnapshotcontents
	PrefixedSnapshotterSecretNameKey      = "csi.storage.k8s.io/snapshotter-secret-name"
	PrefixedSnapshotterSecretNamespaceKey = "csi.storage.k8s.io/snapshotter-secret-namespace"
)

Variables

This section is empty.

Functions

func AddAnnotations

func AddAnnotations(o *metav1.ObjectMeta, vals map[string]string)

AddAnnotations adds the supplied key-values to the annotations on the object

func AddLabels

func AddLabels(o *metav1.ObjectMeta, vals map[string]string)

AddLabels adds the supplied key-values to the labels on the object

func Contains

func Contains(slice []string, key string) bool

func GetPodVolumeNameForPVC

func GetPodVolumeNameForPVC(pod corev1api.Pod, pvcName string) (string, error)

func GetPodVolumesUsingRestic

func GetPodVolumesUsingRestic(pod corev1api.Pod) []string

func GetPodsUsingPVC

func GetPodsUsingPVC(pvcNamespace, pvcName string, corev1 corev1client.PodsGetter) ([]corev1api.Pod, error)

func GetVolumeSnapshotClassForStorageClass

func GetVolumeSnapshotClassForStorageClass(provisioner string, snapshotClient snapshotter.SnapshotV1beta1Interface) (*snapshotv1beta1api.VolumeSnapshotClass, error)

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

func GetVolumeSnapshotContentForVolumeSnapshot

func GetVolumeSnapshotContentForVolumeSnapshot(volSnap *snapshotv1beta1api.VolumeSnapshot, snapshotClient snapshotter.SnapshotV1beta1Interface, log logrus.FieldLogger, shouldWait bool) (*snapshotv1beta1api.VolumeSnapshotContent, error)

GetVolumeSnapshotContentForVolumeSnapshot returns the volumesnapshotcontent object associated with the volumesnapshot

func IsPVCBackedUpByRestic

func IsPVCBackedUpByRestic(pvcNamespace, pvcName string, podClient corev1client.PodsGetter) (bool, error)

func IsVolumeSnapshotClassHasListerSecret

func IsVolumeSnapshotClassHasListerSecret(vc *snapshotv1beta1api.VolumeSnapshotClass) bool

IsVolumeSnapshotClassHasListerSecret returns whether a volumesnapshotclass has a snapshotlister secret

func IsVolumeSnapshotContentHasDeleteSecret

func IsVolumeSnapshotContentHasDeleteSecret(vsc *snapshotv1beta1api.VolumeSnapshotContent) bool

IsVolumeSnapshotContentHasDeleteSecret returns whether a volumesnapshotcontent has a deletesnapshot secret

func IsVolumeSnapshotHasVSCDeleteSecret

func IsVolumeSnapshotHasVSCDeleteSecret(vs *snapshotv1beta1api.VolumeSnapshot) bool

IsVolumeSnapshotHasVSCDeleteSecret returns whether a volumesnapshot should set the deletesnapshot secret for the static volumesnapshotcontent that is created on restore

Types

This section is empty.

Jump to

Keyboard shortcuts

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