persistentvolume

package
v0.0.0-...-81cd6e7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

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.

func NewPVC

func NewPVC(pvcName, namespace string, labels map[string]string) *corev1.PersistentVolumeClaim

NewPVC retuns a new k8s 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.

Jump to

Keyboard shortcuts

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