Documentation ¶
Index ¶
- func CreateOrUpdatePVC(ctx context.Context, c client.Client, pvc *corev1.PersistentVolumeClaim, ...) error
- func LabelsEqual(current, desired *corev1.PersistentVolumeClaim) bool
- func ListPVC(ctx context.Context, c client.Client, namespace string, ...) ([]corev1.PersistentVolumeClaim, error)
- func MutateLabelsOnly(current, desired *corev1.PersistentVolumeClaim)
- func NewPVC(pvcName, namespace string, labels map[string]string) *corev1.PersistentVolumeClaim
- type EqualityPVCFunc
- type MutatePVCFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdatePVC ¶
func CreateOrUpdatePVC(ctx context.Context, c client.Client, pvc *corev1.PersistentVolumeClaim, equal EqualityPVCFunc, mutate MutatePVCFunc) error
CreateOrUpdatePVC attempts first to get the given persistentvolumeclaim. If the persistentvolumeclaim does not exist, the persistentvolumeclaim will be created. Otherwise, if the persistentvolumeclaim exists and the provided comparison func detects any changes an update is attempted. Updates are retried with backoff (See retry.DefaultRetry). Returns on failure an non-nil error.
func LabelsEqual ¶
func LabelsEqual(current, desired *corev1.PersistentVolumeClaim) bool
LabelsEqual return only true if the pvcs are equal in labels only.
func ListPVC ¶
func ListPVC(ctx context.Context, c client.Client, namespace string, selector map[string]string) ([]corev1.PersistentVolumeClaim, error)
List returns a list of pods that match the given selector.
func MutateLabelsOnly ¶
func MutateLabelsOnly(current, desired *corev1.PersistentVolumeClaim)
MutateLabelsOnly is a default mutate function implementation that copies only the labels from desired to current persistentvolumeclaim.
Types ¶
type EqualityPVCFunc ¶
type EqualityPVCFunc func(current, desired *corev1.PersistentVolumeClaim) bool
EqualityPVCFunc is the type for functions that compare two persistentvolumeclaims. Return true if two persistentvolumeclaim are equal.
type MutatePVCFunc ¶
type MutatePVCFunc func(current, desired *corev1.PersistentVolumeClaim)
MutatePVCFunc is the type for functions that mutate the current persistentvolumeclaim by applying the values from the desired persistentvolumeclaim.