util

package
v1.1.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 GetAnnotationFromSnapshot

func GetAnnotationFromSnapshot(itemSnapshot interface{}) (string, error)

func GetKubeClient

func GetKubeClient(config *rest.Config, logger logrus.FieldLogger) (*kubernetes.Clientset, error)

func GetSnapshotFromPVCAnnotation

func GetSnapshotFromPVCAnnotation(snapshotAnnotation string, itemSnapshot interface{}) error

func RetrieveStorageClassMapping

func RetrieveStorageClassMapping(config *rest.Config, veleroNs string, logger logrus.FieldLogger) (map[string]string, error)

func SelfLinkToCRDName

func SelfLinkToCRDName(selfLink string) string

* Converts a K8S Self Link into the CRD name. Supports namespaced and cluster level CRs * K8S Cluster Resource Self Link format: /api/<version>/<resource plural name>/<item name>, * e.g. /api/v1/persistentvolumes/pvc-3240e5ed-9a97-446c-a6ab-b2442d852d04 * K8S Namespace resource Self Link format: /api/<version>/namespaces/<namespace>/<resource plural name>/<item name>, * e.g. /api/v1/namespaces/kibishii/persistentvolumeclaims/etcd0-pv-claim * K8S Resource Name = <resource plural name>, e.g. persistentvolumes * Custom Resource Cluster Self Link format: /apis/<CR group>/<version>/<CR plural name>/<item name>, * e.g. /api/cnsdp.vmware.com/v1/backuprepositories/br-1 * Custom Resource Namespace Self Link format: /apis/<CR group>/<version>/namespaces/<namespace>/<CR plural name>/<item name>, * e.g. /apis/velero.io/v1/namespaces/velero/backups/kibishii-1 * Custom Resource Name = <CR plural name>.<CR group>, e.g. backups.velero.io

func UpdateSnapshotWithNewNamespace

func UpdateSnapshotWithNewNamespace(itemSnapshot *backupdriverv1.Snapshot, namespace string) (backupdriverv1.Snapshot, error)

func UpdateSnapshotWithNewStorageClass

func UpdateSnapshotWithNewStorageClass(config *rest.Config, itemSnapshot *backupdriverv1.Snapshot, storageClassMapping map[string]string, logger logrus.FieldLogger) (backupdriverv1.Snapshot, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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