controllers

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StorageClassReplicationParamEnabledValue value of the replication-enabled flag for which replication is considered to be enabled
	StorageClassReplicationParamEnabledValue = "true"
	// DefaultRetryInterval default interval after which controllers reconcile objects
	DefaultRetryInterval = 2 * time.Second

	// Self typically used when remote cluster is same as source
	Self = "self"

	// RemoteRetentionValueRetain is the value for remotePVRetentionPolicy or remoteRGRetentionPolicy to mean retain
	RemoteRetentionValueRetain = "retain"
	// RemoteRetentionValueDelete is the value for remotePVRetentionPolicy or remoteRGRetentionPolicy to mean delete
	RemoteRetentionValueDelete = "delete"

	// FailOver failover replication action name
	FailOver = "failover"
	// FailBack failback replication action name
	FailBack = "failback"
	// Suspend suspend replication action name
	Suspend = "suspend"
	// Resume resume replication action name
	Resume = "resume"
	// Establish establish replication action name
	Establish = "establish"
	// TestFailOver test failover replication action name
	TestFailOver = "testfailover"
	// TestFailOverStop stop test failover replication action name
	TestFailOverStop = "testfailoverstop"

	// KubeSystemNamespace indicates the namespace of the system which the controller is installed on.
	KubeSystemNamespace = "kube-system"
	// ClusterUID indicates the clusterUID retrieved from the KubeSystem.
	ClusterUID = "clusterUID"
	// NodeReScanned will flag the current rescan status
	NodeReScanned = "node-rescanned"
)

Variables

View Source
var (
	// StorageClassReplicationParam — storage class params to flag creation of replicated volumes
	StorageClassReplicationParam string
	// StorageClassRemoteStorageClassParam — storage class param for the name of the remote storage class
	StorageClassRemoteStorageClassParam string
	// StorageClassRemoteClusterParam — storage class params for the remote cluster identification
	StorageClassRemoteClusterParam string
	// ReplicationFinalizer — finalizer used by the replication sidecar and common controller for pre delete hook
	ReplicationFinalizer string
	// RGFinalizer - finalizer used by common controller for pre-delete hook for RG
	RGFinalizer string
	// RemoteVolumeAnnotation — annotation on the local PVC for details about the created remote volume
	RemoteVolumeAnnotation string
	// RemoteStorageClassAnnotation — annotation on the local PVC for the name of the remote storage class, to be used for remote PV.
	RemoteStorageClassAnnotation string
	// PVCProtectionComplete - annotation which implies that the local sidecar has completed its actions for PVC
	PVCProtectionComplete string
	// PVProtectionComplete - annotation which implies that the local sidecar has completed its actions for PV
	PVProtectionComplete string
	// PVCSyncComplete - Annotation which is set by the utils controller to indicate that it has finished the full PVC sync cycle
	PVCSyncComplete string
	// PVSyncComplete  - Annotation which is set by the utils controller to indicate that it has finished the full PV sync cycle
	PVSyncComplete string
	// ContextPrefix — prefix, if added to any of the key of protection-group-attributes, should be added as annotation to the DellCSIReplicationGroup
	ContextPrefix string
	// ProtectionGroupRemovedAnnotation - annotation added after the protection-group is successfully removed
	// and is used as a flag by the utils controller to process the deletion of remote replication-group
	ProtectionGroupRemovedAnnotation string
	// DriverName is useful for filtering out objects for a particular driver
	DriverName string
	// RemoteClusterID contains the identifier of the remote cluster
	// Used in annotations to enable utils controller to connect to the remote cluster
	// for syncing objects across clusters
	// Used in labels to enable filtering out objects which are replicated to a particular cluster
	RemoteClusterID string
	// RemoteReplicationGroup contains the name of the associated DellCSIReplicationGroup on the remote cluster
	// Used in annotations as well as labels
	RemoteReplicationGroup string
	// RGSyncComplete indicates whether RGs are synced or not
	RGSyncComplete string
	// RemotePV contains the name of the remotePV object
	RemotePV string
	// RemotePVC contains the name of the remote PVC object
	RemotePVC string
	// RemotePVCNamespace contains the namespace of the remote PVC object
	RemotePVCNamespace string
	// ReplicationGroup contains the name of the local DellCSIReplicationGroup object
	ReplicationGroup string
	// CreatedBy annotation which indicates that this object was created by the replication-controller-manager
	CreatedBy string
	// ResourceRequest contains the requested resource limits of the source PVC
	// To be used while creating the remote PVC
	ResourceRequest string
	// DeletionRequested annotation which will be set to the PV on the object deletion
	DeletionRequested string
	// SynchronizedDeletionStatus indicates what state the PV's synchronized deletion process is in
	// requested: PV has been issued a delete command by the remote controller and needs to run DeleteLocalVolume.
	// complete: DeleteLocalVolume has completed. Placed on PV by replicator sidecar to inform controller that deletion is done.
	SynchronizedDeletionStatus string
	// RemotePVRetentionPolicy indicates whether to retain or delete the target PV
	RemotePVRetentionPolicy string
	// RemoteRGRetentionPolicy indicates whether to retain or delete the target RG
	RemoteRGRetentionPolicy string
	// MigrationRequested  annotation indicates if migration is requested for given volume
	MigrationRequested string
	// MigrationNamespace indicates target pvc namespace
	MigrationNamespace string
	// CreatedByMigrator indicates that this PV's been created by migrator sidecar
	CreatedByMigrator string

	// SnapshotClass name of the desired snapshot class.
	SnapshotClass string
	// SnapshotNamespace name of the target namespace to create snapshots in.
	SnapshotNamespace string
	// ActionProcessedTime indicates when the last action was proccessed by the controller (if needed).
	ActionProcessedTime string

	// MigrationGroup contains the name of the local DellCSIMigrationGroup object
	MigrationGroup string
	// MigrationFinalizer — finalizer used by the migration sidecar for pre delete hook
	MigrationFinalizer string
)

Functions

func AddAnnotation

func AddAnnotation(obj metav1.Object, annotationKey, annotationValue string)

AddAnnotation adds annotation to k8s resources

func AddFinalizerIfNotExist

func AddFinalizerIfNotExist(obj metav1.Object, name string) bool

AddFinalizerIfNotExist adds a finalizer to k8s resource, if it doesn't already exist and returns true else returns false

func AddLabel

func AddLabel(obj metav1.Object, labelKey, labelValue string)

AddLabel adds labels to k8s resources

func DeleteLabel added in v1.4.0

func DeleteLabel(obj metav1.Object, labelKey string) bool

DeleteLabel deletes labels from k8s resources

func GetPodNameFromEnv

func GetPodNameFromEnv() string

GetPodNameFromEnv gets value of X_CSI_REPLICATION_POD_NAME env variable

func GetPodNameSpaceFromEnv

func GetPodNameSpaceFromEnv() string

GetPodNameSpaceFromEnv gets value of X_CSI_REPLICATION_POD_NAMESPACE env variable

func IgnoreIfFinalError

func IgnoreIfFinalError(err error) error

IgnoreIfFinalError return error only if it is not final

func InitLabelsAndAnnotations

func InitLabelsAndAnnotations(domain string)

InitLabelsAndAnnotations initializes package visible constants by using customizable domain variable

func IsCSIFinalError

func IsCSIFinalError(err error) bool

IsCSIFinalError return true only if there is no point in retrying

func PublishControllerEvent

func PublishControllerEvent(ctx context.Context, client ctrlClient.Client, recorder record.EventRecorder, eventType string, reason string, msg string) error

PublishControllerEvent publishes event to all contoller pods

func RemoveFinalizerIfExists

func RemoveFinalizerIfExists(obj metav1.Object, name string) bool

RemoveFinalizerIfExists removes finalizer from k8s resource and returns true if exists, otherwise returns false

func UpdateConditions

func UpdateConditions(rg *repv1.DellCSIReplicationGroup, condition repv1.LastAction, maxConditions int)

UpdateConditions updates conditions status field by adding last action condition

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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