cephfscg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// VGS status labels for lifecycle management
	// These labels are used to track VolumeGroupSnapshot state for differential sync
	VGSStatusLabelKey = "ramen.openshift.io/vgs-status"
	VGSStatusCurrent  = "current"  // Active VGS used for current sync cycle
	VGSStatusPrevious = "previous" // Previous VGS used as base for differential sync
)

Variables

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

Functions

func DeleteRGD

func DeleteRGD(ctx context.Context, k8sClient client.Client, ownerName, ownerNamespace string, logger logr.Logger,
) error

func DeleteRGS

func DeleteRGS(ctx context.Context, k8sClient client.Client, ownerName, ownerNamespace string, logger logr.Logger,
) error

func DeleteTypedObjectList

func DeleteTypedObjectList[T client.Object](ctx context.Context, k8sClient client.Client, items []T, logger logr.Logger,
) error

func GetPVCfromStorageHandle

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

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 IsVGSReady

func IsVGSReady(vgs client.Object) bool

IsVGSReady checks if a VolumeGroupSnapshot is ready to use

func ListReplicationGroupByOwner

func ListReplicationGroupByOwner(ctx context.Context, k8sClient client.Client, objList client.ObjectList, ownerName,
	ownerNamespace string, logger logr.Logger,
) error

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 ToPointerSlice

func ToPointerSlice[T any](items []T) []*T

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(
		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 NewDiffVolumeGroupSourceHandler

func NewDiffVolumeGroupSourceHandler(
	client client.Client,
	rgs *ramendrv1alpha1.ReplicationGroupSource,
	defaultCephFSCSIDriverName string,
	vsHandler *volsync.VSHandler,
	logger logr.Logger,
) VolumeGroupSourceHandler

func NewVolumeGroupSourceHandler

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

Jump to

Keyboard shortcuts

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