cephfscg

package
v0.0.0-...-546f89c Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VolumeGroupSnapshotNameFormat = "cephfscg-%s"
	RestorePVCinCGNameFormat      = "cephfscg-%s"
	SnapshotGroup                 = "snapshot.storage.k8s.io"
	SnapshotGroupKind             = "VolumeSnapshot"
)

Functions

func GetPVCfromStorageHandle

func GetPVCfromStorageHandle(
	ctx context.Context,
	k8sClient client.Client,
	storageHandle string,
) (*corev1.PersistentVolumeClaim, error)

func GetRestoreStorageClass

func GetRestoreStorageClass(
	ctx context.Context, k8sClient client.Client, storageClassName string,
	defaultCephFSCSIDriverName string,
) (*storagev1.StorageClass, error)

Copied from func (v *VSHandler) ModifyRSSpecForCephFS

func GetStorageClass

func GetStorageClass(
	ctx context.Context, k8sClient client.Client, storageClassName *string,
) (*storagev1.StorageClass, error)

Copied from func (v *VSHandler) getStorageClass(

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,
	vsHandler *volsync.VSHandler,
	volumeGroupHandler VolumeGroupSourceHandler,
	logger logr.Logger,
) statemachine.ReplicationMachine

Types

type RestoredPVC

type RestoredPVC struct {
	// Application PVC Name
	SourcePVCName string
	// Restored PVC Name
	RestoredPVCName string
	// VolumeSnapsht Name of the application PVC in VolumeGroupSnaoshot
	VolumeSnapshotName string
}

type VSCGHandler

type VSCGHandler interface {
	CreateOrUpdateReplicationGroupDestination(
		replicationGroupDestinationName, replicationGroupDestinationNamespace string,
		rdSpecsInGroup []ramendrv1alpha1.VolSyncReplicationDestinationSpec,
	) (*ramendrv1alpha1.ReplicationGroupDestination, error)

	CreateOrUpdateReplicationGroupSource(
		replicationGroupSourceName, replicationGroupSourceNamespace string,
		runFinalSync bool,
	) (*ramendrv1alpha1.ReplicationGroupSource, bool, error)

	GetLatestImageFromRGD(
		ctx context.Context, pvcName, pvcNamespace 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,
	) error

	RestoreVolumesFromVolumeGroupSnapshot(
		ctx context.Context, owner metav1.Object,
	) ([]RestoredPVC, error)

	CreateOrUpdateReplicationSourceForRestoredPVCs(
		ctx context.Context,
		manual string,
		restoredPVCs []RestoredPVC,
		owner metav1.Object,
	) ([]*corev1.ObjectReference, error)

	CheckReplicationSourceForRestoredPVCsCompleted(
		ctx context.Context,
		replicationSources []*corev1.ObjectReference,
	) (bool, error)

	// Only cleanup restored pvc and volumegoupsnapshot
	CleanVolumeGroupSnapshot(
		ctx context.Context,
	) error
}

func NewVolumeGroupSourceHandler

func NewVolumeGroupSourceHandler(
	client client.Client,
	rgs *ramendrv1alpha1.ReplicationGroupSource,
	defaultCephFSCSIDriverName string,
	logger logr.Logger,
) VolumeGroupSourceHandler

Jump to

Keyboard shortcuts

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