controllers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 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 for use 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"
	FailBack         = "failback"
	Suspend          = "suspend"
	Resume           = "resume"
	Establish        = "establish"
	TestFailOver     = "testfailover"
	TestFailOverStop = "testfailoverstop"
)

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
	// 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
	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 string
	// 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
	// RemotePVRetentionPolicy
	// Indicates whether to retain or delete the target PV
	RemotePVRetentionPolicy string
	// RemoteRGRetentionPolicy
	// Indicates whether to retain or delete the target RG
	RemoteRGRetentionPolicy 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

AddFinalizer 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 GetPodNameFromEnv

func GetPodNameFromEnv() string

func GetPodNameSpaceFromEnv

func GetPodNameSpaceFromEnv() string

func IgnoreIfFinalError

func IgnoreIfFinalError(err error) error

IgnoreIfFinalError return error only if it is not final

func InitLabelsAndAnnotations

func InitLabelsAndAnnotations(domain string)

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

Publishes event to all contoller pods

func RemoveFinalizerIfExists

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

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

func UpdateConditions

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

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