Documentation
¶
Index ¶
- Variables
- func DeleteRGD(ctx context.Context, k8sClient client.Client, ownerName, ownerNamespace string, ...) error
- func DeleteRGS(ctx context.Context, k8sClient client.Client, ownerName, ownerNamespace string, ...) error
- func DeleteTypedObjectList[T client.Object](ctx context.Context, k8sClient client.Client, items []T, logger logr.Logger) error
- func GetPVCfromStorageHandle(ctx context.Context, k8sClient client.Client, storageHandle string) (*corev1.PersistentVolumeClaim, error)
- func GetRGD(ctx context.Context, k8sClient client.Client, name, namespace string, ...) (*ramendrv1alpha1.ReplicationGroupDestination, error)
- func GetRGS(ctx context.Context, k8sClient client.Client, name, namespace string, ...) (*ramendrv1alpha1.ReplicationGroupSource, error)
- func GetStorageClass(ctx context.Context, k8sClient client.Client, storageClassName *string) (*storagev1.StorageClass, error)
- func IsPrepareForFinalSyncTriggered(rgs *ramendrv1alpha1.ReplicationGroupSource) bool
- func ListReplicationGroupByOwner(ctx context.Context, k8sClient client.Client, objList client.ObjectList, ...) error
- func NewRGDMachine(client client.Client, ...) statemachine.ReplicationMachine
- func NewRGSMachine(client client.Client, ...) statemachine.ReplicationMachine
- func PauseRGD(ctx context.Context, k8sClient client.Client, ...) error
- func ToPointerSlice[T any](items []T) []*T
- type RestoredPVC
- type VSCGHandler
- type VolumeGroupSourceHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RestorePVCinCGNameFormat = "vs-%s" SnapshotGroup = "snapshot.storage.k8s.io" SnapshotGroupKind = "VolumeSnapshot" )
Functions ¶
func DeleteTypedObjectList ¶
func GetPVCfromStorageHandle ¶
func GetRGD ¶
func GetRGD(ctx context.Context, k8sClient client.Client, name, namespace string, log logr.Logger, ) (*ramendrv1alpha1.ReplicationGroupDestination, error)
func GetRGS ¶
func GetRGS(ctx context.Context, k8sClient client.Client, name, namespace string, log logr.Logger, ) (*ramendrv1alpha1.ReplicationGroupSource, error)
func GetStorageClass ¶
func GetStorageClass( ctx context.Context, k8sClient client.Client, storageClassName *string, ) (*storagev1.StorageClass, error)
Copied from func (v *VSHandler) getStorageClass(
func IsPrepareForFinalSyncTriggered ¶
func IsPrepareForFinalSyncTriggered(rgs *ramendrv1alpha1.ReplicationGroupSource) bool
func NewRGDMachine ¶
func NewRGDMachine( client client.Client, replicationGroupDestination *ramendrv1alpha1.ReplicationGroupDestination, vsHandler *volsync.VSHandler, logger logr.Logger, ) statemachine.ReplicationMachine
func NewRGSMachine ¶
func NewRGSMachine( client client.Client, replicationGroupSource *ramendrv1alpha1.ReplicationGroupSource, vrg *ramendrv1alpha1.VolumeReplicationGroup, vsHandler *volsync.VSHandler, volumeGroupHandler VolumeGroupSourceHandler, logger logr.Logger, ) statemachine.ReplicationMachine
func PauseRGD ¶
func PauseRGD(ctx context.Context, k8sClient client.Client, rgd *ramendrv1alpha1.ReplicationGroupDestination, log logr.Logger, ) error
func ToPointerSlice ¶
func ToPointerSlice[T any](items []T) []*T
Types ¶
type RestoredPVC ¶
type VSCGHandler ¶
type VSCGHandler interface {
CreateOrUpdateReplicationGroupDestination(
replicationGroupDestinationName, replicationGroupDestinationNamespace string,
rdSpecsInGroup []ramendrv1alpha1.VolSyncReplicationDestinationSpec,
) (*ramendrv1alpha1.ReplicationGroupDestination, error)
CreateOrUpdateReplicationGroupSource(
replicationGroupSourceNamespace string,
runFinalSync bool,
) (*ramendrv1alpha1.ReplicationGroupSource, bool, error)
GetLatestImageFromRGD(
rgd *ramendrv1alpha1.ReplicationGroupDestination, pvcName string,
) (*corev1.TypedLocalObjectReference, error)
EnsurePVCfromRGD(
rdSpec ramendrv1alpha1.VolSyncReplicationDestinationSpec, failoverAction bool,
) error
DeleteLocalRDAndRS(rd *volsyncv1alpha1.ReplicationDestination) error
GetRDInCG() ([]ramendrv1alpha1.VolSyncReplicationDestinationSpec, error)
CheckIfPVCMatchLabel(pvcLabels map[string]string) (bool, error)
}
func NewVSCGHandler ¶
func NewVSCGHandler( ctx context.Context, k8sClient client.Client, instance *ramendrv1alpha1.VolumeReplicationGroup, volumeGroupSnapshotSource *metav1.LabelSelector, vsHandler *volsync.VSHandler, cgName string, logger logr.Logger, ) VSCGHandler
type VolumeGroupSourceHandler ¶
type VolumeGroupSourceHandler interface {
CreateOrUpdateVolumeGroupSnapshot(
ctx context.Context, owner metav1.Object,
) (bool, error)
RestoreVolumesFromVolumeGroupSnapshot(
ctx context.Context, owner metav1.Object,
) ([]RestoredPVC, error)
CreateOrUpdateReplicationSourceForRestoredPVCs(
ctx context.Context,
manual string,
restoredPVCs []RestoredPVC,
owner metav1.Object,
vrg *ramendrv1alpha1.VolumeReplicationGroup,
isSubmarinerEnabled bool,
) ([]*corev1.ObjectReference, bool, error)
CheckReplicationSourceForRestoredPVCsCompleted(
ctx context.Context,
replicationSources []*corev1.ObjectReference,
) (bool, error)
// Only cleanup restored pvc and volumegoupsnapshot
CleanVolumeGroupSnapshot(
ctx context.Context,
) error
WaitIfPVCTooNew(
ctx context.Context,
) (bool, error)
// EnsureApplicationPVCsMounted ensures all application PVCs (for this owner/RGS) that
// need to be mounted are mounted (e.g. via mount job) before creating a volume group snapshot.
// Returns (true, nil) when all are ready, (false, nil) to requeue, or (_, err) on error.
EnsureApplicationPVCsMounted(ctx context.Context) (bool, error)
}
func NewVolumeGroupSourceHandler ¶
func NewVolumeGroupSourceHandler( client client.Client, rgs *ramendrv1alpha1.ReplicationGroupSource, defaultCephFSCSIDriverName string, vsHandler *volsync.VSHandler, logger logr.Logger, ) VolumeGroupSourceHandler
Click to show internal directories.
Click to hide internal directories.