Documentation ¶
Index ¶
- type VHOption
- func AccessModes(am []corev1.PersistentVolumeAccessMode) VHOption
- func Capacity(c *resource.Quantity) VHOption
- func CopyMethod(cm volsyncv1alpha1.CopyMethodType) VHOption
- func From(v *VolumeHandler) VHOption
- func FromDestination(d *volsyncv1alpha1.ReplicationDestinationVolumeOptions) VHOption
- func FromSource(s *volsyncv1alpha1.ReplicationSourceVolumeOptions) VHOption
- func StorageClassName(sc *string) VHOption
- func VolumeMode(vm *corev1.PersistentVolumeMode) VHOption
- func VolumeSnapshotClassName(vsc *string) VHOption
- func WithClient(c client.Client) VHOption
- func WithOwner(o client.Object) VHOption
- func WithRecorder(r events.EventRecorder) VHOption
- type VolumeHandler
- func (vh *VolumeHandler) EnsureImage(ctx context.Context, log logr.Logger, src *corev1.PersistentVolumeClaim) (*corev1.TypedLocalObjectReference, error)
- func (vh *VolumeHandler) EnsureNewPVC(ctx context.Context, log logr.Logger, name string, isTemporary bool) (*corev1.PersistentVolumeClaim, error)
- func (vh *VolumeHandler) EnsurePVCFromSrc(ctx context.Context, log logr.Logger, src *corev1.PersistentVolumeClaim, ...) (*corev1.PersistentVolumeClaim, error)
- func (vh *VolumeHandler) GetAccessModes() []corev1.PersistentVolumeAccessMode
- func (vh *VolumeHandler) IsCopyMethodDirect() bool
- func (vh *VolumeHandler) RemoveSnapshotAnnotationFromPVC(ctx context.Context, log logr.Logger, pvcName string) error
- func (vh *VolumeHandler) SetAccessModes(accessModes []corev1.PersistentVolumeAccessMode)
- func (vh *VolumeHandler) UseProvidedPVC(ctx context.Context, pvcName string) (*corev1.PersistentVolumeClaim, error)
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 AccessModes ¶
func AccessModes(am []corev1.PersistentVolumeAccessMode) VHOption
func CopyMethod ¶
func CopyMethod(cm volsyncv1alpha1.CopyMethodType) VHOption
func From ¶
func From(v *VolumeHandler) VHOption
From populates the VolumeHandler as a copy of an existing VolumeHandler
func FromDestination ¶
func FromDestination(d *volsyncv1alpha1.ReplicationDestinationVolumeOptions) VHOption
FromDestination populates the VolumeHandler configuration based on the common destination volume options
func FromSource ¶
func FromSource(s *volsyncv1alpha1.ReplicationSourceVolumeOptions) VHOption
FromSource populates the VolumeHandler configuration based on the common source volume options
func StorageClassName ¶
func VolumeMode ¶ added in v0.11.0
func VolumeMode(vm *corev1.PersistentVolumeMode) VHOption
func VolumeSnapshotClassName ¶
func WithClient ¶
WithClient specifies the Kubernetes client to use
func WithOwner ¶
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 ¶
func (vh *VolumeHandler) EnsureImage(ctx context.Context, log logr.Logger, src *corev1.PersistentVolumeClaim) (*corev1.TypedLocalObjectReference, error)
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, isTemporary bool) (*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 (*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)