volumehandler

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VHOption

type VHOption func(*VolumeHandler)

VHOption functions allow configuration of the VolumeHandler

func Capacity

func Capacity(c *resource.Quantity) VHOption

func From

func From(v *VolumeHandler) VHOption

From populates the VolumeHandler as a copy of an existing VolumeHandler

func FromDestination

FromDestination populates the VolumeHandler configuration based on the common destination volume options

func FromSource

FromSource populates the VolumeHandler configuration based on the common source volume options

func StorageClassName

func StorageClassName(sc *string) VHOption

func VolumeSnapshotClassName

func VolumeSnapshotClassName(vsc *string) VHOption

func WithClient

func WithClient(c client.Client) VHOption

WithClient specifies the Kubernetes client to use

func WithOwner

func WithOwner(o client.Object) VHOption

WithOwner specifies the Object should be the owner of Objects created by the VolumeHandler

func WithRecorder added in v0.5.0

func WithRecorder(r events.EventRecorder) VHOption

type VolumeHandler

type VolumeHandler struct {
	// contains filtered or unexported fields
}

func NewVolumeHandler

func NewVolumeHandler(options ...VHOption) (*VolumeHandler, error)

NewVolumeHandler creates a VolumeHandler based on an ordered list of options.

func (*VolumeHandler) EnsureImage

EnsureImage ensures the presence of a representation of the provided src PVC. It is generated based on the VolumeHandler's configuration and could be of type PersistentVolumeClaim or VolumeSnapshot. It may even be the same PVC as src.

func (*VolumeHandler) EnsureNewPVC

func (vh *VolumeHandler) EnsureNewPVC(ctx context.Context, log logr.Logger,
	name string) (*corev1.PersistentVolumeClaim, error)

nolint: funlen

func (*VolumeHandler) EnsurePVCFromSrc

func (vh *VolumeHandler) EnsurePVCFromSrc(ctx context.Context, log logr.Logger,
	src *corev1.PersistentVolumeClaim, name string, isTemporary bool) (*corev1.PersistentVolumeClaim, error)

EnsurePVCFromSrc ensures the presence of a PVC that is based on the provided src PVC. It is generated based on the VolumeHandler's configuration. It may be the same PVC as src. Note: it's possible to return nil, nil. In this case, the operation should be retried.

func (*VolumeHandler) GetAccessModes

func (vh *VolumeHandler) GetAccessModes() []corev1.PersistentVolumeAccessMode

func (*VolumeHandler) IsCopyMethodDirect added in v0.5.0

func (vh *VolumeHandler) IsCopyMethodDirect() bool

func (*VolumeHandler) RemoveSnapshotAnnotationFromPVC added in v0.4.0

func (vh *VolumeHandler) RemoveSnapshotAnnotationFromPVC(ctx context.Context, log logr.Logger, pvcName string) error

func (*VolumeHandler) SetAccessModes

func (vh *VolumeHandler) SetAccessModes(accessModes []corev1.PersistentVolumeAccessMode)

func (*VolumeHandler) UseProvidedPVC added in v0.4.0

func (vh *VolumeHandler) UseProvidedPVC(ctx context.Context, pvcName string) (*corev1.PersistentVolumeClaim, error)

Jump to

Keyboard shortcuts

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