Documentation
¶
Index ¶
- Constants
- Variables
- func AddAnnotation(obj metav1.Object, key string, value string) bool
- func AddLabel(obj metav1.Object, key string, value string) bool
- func AnnotationIndexFieldFunc(obj client.Object) []string
- func AssertEqual[T comparable](actual T, expected T, exitCode int)
- func CalculateMD5Hash(value any) string
- func ComposePredicates(predicates ...predicate.Predicate) predicate.Predicate
- func CreateOrReplace(ctx context.Context, c client.Client, obj client.Object, ...) error
- func DetectDuplicateInStringSlice(slice []string) bool
- func EventTypePredicate(create, update, del, generic bool) predicate.Predicate
- func FillBackwardCompatibleConsumerConfigValues(storageCluster *ocsv1.StorageCluster, storageConsumerUID string, ...)
- func Find[T any](list []T, f func(item *T) bool) *T
- func FnvHash(s string) uint32
- func GenerateClientOnboardingToken(tokenLifetimeInHours int, privateKeyPath string, consumerIdentifier string) (string, error)
- func GenerateCsiCephFsNodeCephClientName(generation int64, uid types.UID) string
- func GenerateCsiCephFsProvisionerCephClientName(generation int64, uid types.UID) string
- func GenerateCsiNfsNodeCephClientName(generation int64, uid types.UID) string
- func GenerateCsiNfsProvisionerCephClientName(generation int64, uid types.UID) string
- func GenerateCsiRbdNodeCephClientName(generation int64, uid types.UID) string
- func GenerateCsiRbdProvisionerCephClientName(generation int64, uid types.UID) string
- func GenerateNameForCephBlockPool(storageClusterName string) string
- func GenerateNameForCephBlockPoolStorageClass(storageCluster *ocsv1.StorageCluster) string
- func GenerateNameForCephBlockPoolVirtualizationStorageClass(storageCluster *ocsv1.StorageCluster) string
- func GenerateNameForCephCluster(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephClusterFromString(name string) string
- func GenerateNameForCephFilesystem(storageClusterName string) string
- func GenerateNameForCephFilesystemStorageClass(storageCluster *ocsv1.StorageCluster) string
- func GenerateNameForCephNFS(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephNFSBlockPool(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephNetworkFilesystemStorageClass(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephObjectStore(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephObjectStoreUser(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephRbdMirror(initData *ocsv1.StorageCluster) string
- func GenerateNameForCephRgwStorageClass(initData *ocsv1.StorageCluster) string
- func GenerateNameForEncryptedCephBlockPoolStorageClass(initData *ocsv1.StorageCluster) string
- func GenerateNameForGroupSnapshotClass(initData *ocsv1.StorageCluster, groupSnapshotType GroupSnapshotterType) string
- func GenerateNameForNFSService(initData *ocsv1.StorageCluster) string
- func GenerateNameForNFSServiceMonitor(initData *ocsv1.StorageCluster) string
- func GenerateNameForNonResilientCephBlockPool(storageClusterName, failureDomainValue string) string
- func GenerateNameForNonResilientCephBlockPoolStorageClass(storageCluster *ocsv1.StorageCluster) string
- func GenerateNameForSnapshotClass(storageClusterName string, snapshotType SnapshotterType) string
- func GeneratePeerOnboardingToken(tokenLifetimeInHours int, privateKeyPath string, storageClusterUID types.UID) (string, error)
- func GenerateStorageQuotaName(storageClassName, quotaName string) string
- func GetCephClusterInNamespace(ctx context.Context, cl client.Client, namespace string) (*rookCephv1.CephCluster, error)
- func GetCephFSKernelMountOptions(sc *ocsv1.StorageCluster) string
- func GetClusterID(ctx context.Context, kubeClient client.Client, logger *logr.Logger) string
- func GetClusterResourceQuotaName(name string) string
- func GetCountOfRunningPods(podList *corev1.PodList) int
- func GetKMSConfigMap(configMapName string, instance *ocsv1.StorageCluster, client client.Client) (*corev1.ConfigMap, error)
- func GetKeyRotationSpec(sc *ocsv1.StorageCluster) (bool, string)
- func GetOperatorNamespace() (string, error)
- func GetPGBaseUnitSize(osdCount int) int
- func GetPodNamespace() string
- func GetPodsWithLabels(ctx context.Context, kubeClient client.Client, namespace string, ...) (*corev1.PodList, error)
- func GetReadAffinityOptions(sc *ocsv1.StorageCluster) rookCephv1.ReadAffinitySpec
- func GetStorageClassWithName(ctx context.Context, kubeClient client.Client, name string) *storagev1.StorageClass
- func GetStorageClusterInNamespace(ctx context.Context, cl client.Client, namespace string) (*ocsv1.StorageCluster, error)
- func GetStorageConsumerDefaultResourceNames(storageConsumerName, storageConsumerUid string, ...) map[string]string
- func GetStorageRequestName(consumerUUID, storageClaimName string) string
- func GetTopologyConstrainedPools(storageCluster *ocsv1.StorageCluster) string
- func GetWatchNamespace() (string, error)
- func IsClusterOrDeviceSetEncrypted(sc *ocsv1.StorageCluster) bool
- func IsSingleNodeDeployment() bool
- func JsonMustMarshal[T any](value T) []byte
- func MapCephClusterNegativeConditions(conditions *[]conditionsv1.Condition, found *cephv1.CephCluster)
- func MapCephClusterNoConditions(conditions *[]conditionsv1.Condition, reason string, message string)
- func MapExternalCephClusterNegativeConditions(conditions *[]conditionsv1.Condition, found *cephv1.CephCluster)
- func MapNoobaaNegativeConditions(conditions *[]conditionsv1.Condition, found *nbv1.NooBaa)
- func NamePredicate(name string) predicate.Predicate
- func NamespacePredicate(namespace string) predicate.Predicate
- func NewDefaultCephFsGroupSnapshotClass(clusterID, provisionerSecret, namespace, fsName, storageId string) *groupsnapapi.VolumeGroupSnapshotClass
- func NewDefaultCephFsSnapshotClass(clusterID, provisionerSecret, namespace, storageId string) *snapapi.VolumeSnapshotClass
- func NewDefaultCephFsStorageClass(clusterID, fsName, provisionerSecret, nodeSecret, namespace, storageId string) *storagev1.StorageClass
- func NewDefaultEncryptedRbdStorageClass(clusterID, poolName, provisionerSecret, nodeSecret, namespace, ... string, ...) *storagev1.StorageClass
- func NewDefaultNFSStorageClass(...) *storagev1.StorageClass
- func NewDefaultNfsSnapshotClass(clusterID, provisionerSecret, namespace string) *snapapi.VolumeSnapshotClass
- func NewDefaultNonResilientRbdStorageClass(...) *storagev1.StorageClass
- func NewDefaultOBCStorageClass(objectStoreNameSpace, objectStoreName string) *storagev1.StorageClass
- func NewDefaultRbdGroupSnapshotClass(clusterID, provisionerSecret, namespace, pool, storageId string) *groupsnapapi.VolumeGroupSnapshotClass
- func NewDefaultRbdSnapshotClass(clusterID, provisionerSecret, namespace, storageId string) *snapapi.VolumeSnapshotClass
- func NewDefaultRbdStorageClass(...) *storagev1.StorageClass
- func NewDefaultVirtRbdStorageClass(...) *storagev1.StorageClass
- func NewK8sClient(scheme *runtime.Scheme) (client.Client, error)
- func OwnersIndexFieldFunc(obj client.Object) []string
- func ReadEnvVar[T any](envVarName string, defaultValue T, parser func(str string) (T, error)) (T, error)
- func RemoveDuplicatesFromStringSlice(slice []string) []string
- func RemoveExternalCephClusterNegativeConditions(conditions *[]conditionsv1.Condition)
- func RestartPod(ctx context.Context, kubeClient client.Client, logger *logr.Logger, ...)
- func SetCompleteCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func SetErrorCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func SetProgressingCondition(conditions *[]conditionsv1.Condition, reason string, message string)
- func SetVersionMismatchCondition(conditions *[]conditionsv1.Condition, status corev1.ConditionStatus, ...)
- func StorageClassFromExisting(ctx context.Context, kubeClient client.Client, storageClassName string, ...) (*storagev1.StorageClass, error)
- func VolumeGroupSnapshotClassFromExisting(ctx context.Context, kubeClient client.Client, ...) (*groupsnapapi.VolumeGroupSnapshotClass, error)
- func VolumeSnapshotClassFromExisting(ctx context.Context, kubeClient client.Client, volumeSnapshotClassName string, ...) (*snapapi.VolumeSnapshotClass, error)
- type AvailableServices
- type BackwardCompatabilityInfo
- type Clusters
- func (c *Clusters) AreOtherStorageClustersReady(instance *ocsv1.StorageCluster) bool
- func (c *Clusters) GetExternalStorageClusters() []ocsv1.StorageCluster
- func (c *Clusters) GetInternalStorageClusters() []ocsv1.StorageCluster
- func (c *Clusters) GetNames() []string
- func (c *Clusters) GetNamespacedNames() []string
- func (c *Clusters) GetNamespaces() []string
- func (c *Clusters) GetStorageClusters() []ocsv1.StorageCluster
- func (c *Clusters) GetStorageClustersInNamespace(namespace string) []ocsv1.StorageCluster
- func (c *Clusters) HasMultipleStorageClustersInNamespace(namespace string) bool
- func (c *Clusters) HasMultipleStorageClustersWithSameName(name string) bool
- func (c *Clusters) IsExternalStorageClusterExist() bool
- func (c *Clusters) IsInternalAndExternalStorageClustersExist() bool
- func (c *Clusters) IsInternalStorageClusterExist() bool
- type EventReporter
- type GroupSnapshotterType
- type MetadataChangedPredicate
- type SnapshotterType
- type StorageConsumerResources
Constants ¶
const ( StorageClassDriverNamePrefix = "openshift-storage" RbdDriverName = StorageClassDriverNamePrefix + ".rbd.csi.ceph.com" CephFSDriverName = StorageClassDriverNamePrefix + ".cephfs.csi.ceph.com" NfsDriverName = StorageClassDriverNamePrefix + ".nfs.csi.ceph.com" ObcDriverName = StorageClassDriverNamePrefix + ".ceph.rook.io/bucket" )
const ( // EventReasonValidationFailed is used when the StorageCluster spec validation fails EventReasonValidationFailed = "FailedValidation" // EventReasonUninstallPending is used when the StorageCluster uninstall is Pending EventReasonUninstallPending = "UninstallPending" )
const ( // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which is the namespace where the watch activity happens. // this value is empty if the operator is running with clusterScope. WatchNamespaceEnvVar = "WATCH_NAMESPACE" // PodNamespaceEnvVar is the env variable for the pod namespace PodNamespaceEnvVar = "POD_NAMESPACE" // SingleNodeEnvVar is set if StorageCluster needs to be deployed on a single node SingleNodeEnvVar = "SINGLE_NODE" // This configmap is purely for the OCS operator to use. OcsOperatorConfigName = "ocs-operator-config" // This configmap is watched by rook-ceph-operator & is reserved only for manual overrides. RookCephOperatorConfigName = "rook-ceph-operator-config" // These are the keys in the ocs-operator-config configmap ClusterNameKey = "CSI_CLUSTER_NAME" RookCurrentNamespaceOnlyKey = "ROOK_CURRENT_NAMESPACE_ONLY" EnableTopologyKey = "CSI_ENABLE_TOPOLOGY" TopologyDomainLabelsKey = "CSI_TOPOLOGY_DOMAIN_LABELS" EnableNFSKey = "ROOK_CSI_ENABLE_NFS" DisableCSIDriverKey = "ROOK_CSI_DISABLE_DRIVER" EnableCephfsKey = "ROOK_CSI_ENABLE_CEPHFS" // This is the name for the FieldIndex OwnerUIDIndexName = "ownerUID" AnnotationIndexName = "annotation" OdfInfoNamespacedNameClaimName = "odfinfo.odf.openshift.io" ExitCodeThatShouldRestartTheProcess = 42 //ForbidMirroringLabel is used to forbid mirroring for ceph resources such as CephBlockPool ForbidMirroringLabel = "ocs.openshift.io/forbid-mirroring" BlockPoolMirroringTargetIDAnnotation = "ocs.openshift.io/mirroring-target-id" RequestMaintenanceModeAnnotation = "ocs.openshift.io/request-maintenance-mode" CephRBDMirrorName = "cephrbdmirror" OcsClientTimeout = 10 * time.Second StorageClientMappingConfigName = "storage-client-mapping" ExternalClassLabelKey = "storageclass.ocs.openshift.io/is-external" StorageConsumerMirroringInfoAnnotation = "ocs.openshift.io/consumer-mirroring-info" ForceDeletionAnnotationKey = "ocs.openshift.io/force-deletion" RookForceDeletionAnnotationKey = "rook.io/force-deletion" BackwardCompatabilityInfoAnnotationKey = "ocs.openshift.io/backward-compatability-info" CsiCephUserGenerationLabelKey = "ocs.openshift.io/csi-ceph-user-generation" CreatedAtDfVersionLabelKey = "ocs.openshift.io/created-at-df-version" )
const ( // ExternalClusterConnectingReason indicates the storage cluster is trying to connect to an external one. ExternalClusterConnectingReason = "ExternalClusterStateConnecting" // ExternalClusterUnknownReason is for unknown cluster condition/state ExternalClusterUnknownReason = "ExternalClusterStateUnknownCondition" // ExternalClusterErrorReason indicates an error state ExternalClusterErrorReason = "ExternalClusterStateError" // VersionValidReason indicates version in SC CR and operator is equal VersionValidReason = "VersionMatched" )
const ( // Reserved RadosNamespaceName for internal use and their representation at different layes ImplicitRbdRadosNamespaceName = "<implicit>" TicketAnnotation = "ocs.openshift.io/provider-onboarding-ticket" AnnotationNonResilientPoolsTopologyKey = "ocs.openshift.io/non-resilient-pools-topology-key" )
const OcsMetricsExporterCephClientName = "ocs-metrics-exporter-ceph-auth"
const OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"
OperatorNamespaceEnvVar is the constant for env variable OPERATOR_NAMESPACE which is the namespace where operator pod is deployed.
Variables ¶
var ( // PhaseIgnored is used when a resource is ignored PhaseIgnored = "Ignored" // PhaseProgressing is used when SetProgressingCondition is called PhaseProgressing = "Progressing" // PhaseError is used when SetErrorCondition is called PhaseError = "Error" // PhaseReady is used when SetCompleteCondition is called PhaseReady = "Ready" // PhaseNotReady is used when waiting for system to be ready // after reconcile is successful PhaseNotReady = "Not Ready" // PhaseClusterExpanding is used when cluster is expanding capacity PhaseClusterExpanding = "Expanding Capacity" // PhaseDeleting is used when cluster is deleting PhaseDeleting = "Deleting" // PhaseConnecting is used when cluster is connecting to external cluster PhaseConnecting = "Connecting" // PhaseOnboarding is used when consumer is Onboarding PhaseOnboarding = "Onboarding" )
These constants represent the overall Phase as used by .Status.Phase
var (
UnsupportedDriver = errors.New("unsupportedDriver")
)
var (
UnsupportedProvisioner = errors.New("unsupportedProvisioner")
)
Functions ¶
func AssertEqual ¶
func AssertEqual[T comparable](actual T, expected T, exitCode int)
func CalculateMD5Hash ¶
func ComposePredicates ¶
ComposePredicates will compose a variable number of predicates and return a predicate that will allow events that are allowed by any of the given predicates.
func CreateOrReplace ¶
func EventTypePredicate ¶
EventTypePredicate return a predicate to filter events based on their respective event type. This helper allows for the selection of multiple types resulting in a predicate that can filter in more than a single event type
func FillBackwardCompatibleConsumerConfigValues ¶
func FillBackwardCompatibleConsumerConfigValues( storageCluster *ocsv1.StorageCluster, storageConsumerUID string, resourceMap StorageConsumerResources, )
func FnvHash ¶
fnv64a is a 64-bit non-cryptographic hash algorithm with a low collision and a high distribution rate. https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
func GenerateNameForCephBlockPoolStorageClass ¶
func GenerateNameForCephBlockPoolStorageClass(storageCluster *ocsv1.StorageCluster) string
func GenerateNameForCephBlockPoolVirtualizationStorageClass ¶
func GenerateNameForCephBlockPoolVirtualizationStorageClass(storageCluster *ocsv1.StorageCluster) string
func GenerateNameForCephCluster ¶
func GenerateNameForCephCluster(initData *ocsv1.StorageCluster) string
func GenerateNameForCephFilesystemStorageClass ¶
func GenerateNameForCephFilesystemStorageClass(storageCluster *ocsv1.StorageCluster) string
func GenerateNameForCephNFS ¶
func GenerateNameForCephNFS(initData *ocsv1.StorageCluster) string
func GenerateNameForCephNFSBlockPool ¶
func GenerateNameForCephNFSBlockPool(initData *ocsv1.StorageCluster) string
func GenerateNameForCephNetworkFilesystemStorageClass ¶
func GenerateNameForCephNetworkFilesystemStorageClass(initData *ocsv1.StorageCluster) string
func GenerateNameForCephObjectStore ¶
func GenerateNameForCephObjectStore(initData *ocsv1.StorageCluster) string
func GenerateNameForCephObjectStoreUser ¶
func GenerateNameForCephObjectStoreUser(initData *ocsv1.StorageCluster) string
func GenerateNameForCephRbdMirror ¶
func GenerateNameForCephRbdMirror(initData *ocsv1.StorageCluster) string
func GenerateNameForCephRgwStorageClass ¶
func GenerateNameForCephRgwStorageClass(initData *ocsv1.StorageCluster) string
func GenerateNameForEncryptedCephBlockPoolStorageClass ¶
func GenerateNameForEncryptedCephBlockPoolStorageClass(initData *ocsv1.StorageCluster) string
func GenerateNameForGroupSnapshotClass ¶
func GenerateNameForGroupSnapshotClass(initData *ocsv1.StorageCluster, groupSnapshotType GroupSnapshotterType) string
func GenerateNameForNFSService ¶
func GenerateNameForNFSService(initData *ocsv1.StorageCluster) string
func GenerateNameForNFSServiceMonitor ¶
func GenerateNameForNFSServiceMonitor(initData *ocsv1.StorageCluster) string
func GenerateNameForNonResilientCephBlockPoolStorageClass ¶
func GenerateNameForNonResilientCephBlockPoolStorageClass(storageCluster *ocsv1.StorageCluster) string
func GenerateNameForSnapshotClass ¶
func GenerateNameForSnapshotClass(storageClusterName string, snapshotType SnapshotterType) string
GenerateNameForSnapshotClass function generates 'SnapshotClass' name. 'snapshotType' can be: 'RbdSnapshotter' or 'CephfsSnapshotter' or 'NfsSnapshotter'
func GeneratePeerOnboardingToken ¶
func GeneratePeerOnboardingToken(tokenLifetimeInHours int, privateKeyPath string, storageClusterUID types.UID) (string, error)
GeneratePeerOnboardingToken generates a ocs-peer token valid for a duration of "tokenLifetimeInHours". The token content is predefined and signed by the private key which'll be read from supplied "privateKeyPath".
func GetCephClusterInNamespace ¶
func GetCephClusterInNamespace(ctx context.Context, cl client.Client, namespace string) (*rookCephv1.CephCluster, error)
func GetCephFSKernelMountOptions ¶
func GetCephFSKernelMountOptions(sc *ocsv1.StorageCluster) string
GetCephFSKernelMountOptions returns the kernel mount options for CephFS based on the spec on the StorageCluster
func GetClusterID ¶
getClusterID returns the cluster ID of the OCP-Cluster
func GetCountOfRunningPods ¶
getCountOfRunningPods gives the count of pods in running state in a given pod list
func GetKMSConfigMap ¶
func GetKMSConfigMap(configMapName string, instance *ocsv1.StorageCluster, client client.Client) (*corev1.ConfigMap, error)
GetKMSConfigMap function try to return a KMS ConfigMap. if 'kmsValidateFunc' function is present it try to validate the retrieved config map.
func GetKeyRotationSpec ¶
func GetKeyRotationSpec(sc *ocsv1.StorageCluster) (bool, string)
func GetOperatorNamespace ¶
GetOperatorNamespace returns the namespace where the operator is deployed.
func GetPGBaseUnitSize ¶
func GetPodNamespace ¶
func GetPodNamespace() string
GetPodNamespace returns the namespace where the pod is deployed
func GetPodsWithLabels ¶
func GetPodsWithLabels(ctx context.Context, kubeClient client.Client, namespace string, labelSelector map[string]string) (*corev1.PodList, error)
GetPodsWithLabels gives all the pods that are in a namespace after filtering them based on the given label selector
func GetReadAffinityOptions ¶
func GetReadAffinityOptions(sc *ocsv1.StorageCluster) rookCephv1.ReadAffinitySpec
getReadAffinityyOptions returns the read affinity options based on the spec on the StorageCluster.
func GetStorageClassWithName ¶
func GetStorageClassWithName(ctx context.Context, kubeClient client.Client, name string) *storagev1.StorageClass
GetStorageClassWithName returns the storage class object by name
func GetStorageConsumerDefaultResourceNames ¶
func GetStorageConsumerDefaultResourceNames( storageConsumerName, storageConsumerUid string, availableServices *AvailableServices, ) map[string]string
func GetStorageRequestName ¶
GetStorageRequestName generates a name for a StorageRequest resource.
func GetTopologyConstrainedPools ¶
func GetTopologyConstrainedPools(storageCluster *ocsv1.StorageCluster) string
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func IsClusterOrDeviceSetEncrypted ¶
func IsClusterOrDeviceSetEncrypted(sc *ocsv1.StorageCluster) bool
func IsSingleNodeDeployment ¶
func IsSingleNodeDeployment() bool
IsSingleNodeDeployment returns true if StorageCluster needs to be deployed on a single node.
func JsonMustMarshal ¶
func MapCephClusterNegativeConditions ¶
func MapCephClusterNegativeConditions(conditions *[]conditionsv1.Condition, found *cephv1.CephCluster)
MapCephClusterNegativeConditions maps the status states from CephCluster resource into ocs status conditions. This will only look for negative conditions: !Available, Degraded, Progressing
func MapCephClusterNoConditions ¶
func MapCephClusterNoConditions(conditions *[]conditionsv1.Condition, reason string, message string)
MapCephClusterNoConditions sets status conditions to progressing. Used when component operator isn't reporting any status, and we have to assume progress.
func MapExternalCephClusterNegativeConditions ¶
func MapExternalCephClusterNegativeConditions(conditions *[]conditionsv1.Condition, found *cephv1.CephCluster)
MapExternalCephClusterNegativeConditions maps the status states from CephCluster resource into ocs status conditions. This will only look for negative conditions: !Available, Degraded, Progressing
func MapNoobaaNegativeConditions ¶
func MapNoobaaNegativeConditions(conditions *[]conditionsv1.Condition, found *nbv1.NooBaa)
MapNoobaaNegativeConditions records noobaa related conditions This will only look for negative conditions: !Available, Degraded, Progressing
func NamePredicate ¶
Name Predicate return a predicate the filter events produced by resources that matches the given name
func NamespacePredicate ¶
func NewDefaultCephFsGroupSnapshotClass ¶
func NewDefaultCephFsGroupSnapshotClass( clusterID, provisionerSecret, namespace, fsName, storageId string, ) *groupsnapapi.VolumeGroupSnapshotClass
func NewDefaultCephFsSnapshotClass ¶
func NewDefaultCephFsSnapshotClass( clusterID, provisionerSecret, namespace, storageId string, ) *snapapi.VolumeSnapshotClass
func NewDefaultCephFsStorageClass ¶
func NewDefaultCephFsStorageClass( clusterID, fsName, provisionerSecret, nodeSecret, namespace, storageId string, ) *storagev1.StorageClass
func NewDefaultEncryptedRbdStorageClass ¶
func NewDefaultEncryptedRbdStorageClass( clusterID, poolName, provisionerSecret, nodeSecret, namespace, encryptionServiceName string, KeyRotationAnnotationValue string, ) *storagev1.StorageClass
func NewDefaultNFSStorageClass ¶
func NewDefaultNFSStorageClass( clusterID, nfsCluster, fsName, server, provisionerSecret, nodeSecret, namespace string, ) *storagev1.StorageClass
func NewDefaultNfsSnapshotClass ¶
func NewDefaultNfsSnapshotClass( clusterID, provisionerSecret, namespace string, ) *snapapi.VolumeSnapshotClass
func NewDefaultNonResilientRbdStorageClass ¶
func NewDefaultNonResilientRbdStorageClass( clusterID, topologyConstrainedPools, provisionerSecret, nodeSecret, namespace, storageId string, ) *storagev1.StorageClass
func NewDefaultOBCStorageClass ¶
func NewDefaultOBCStorageClass( objectStoreNameSpace, objectStoreName string, ) *storagev1.StorageClass
func NewDefaultRbdGroupSnapshotClass ¶
func NewDefaultRbdGroupSnapshotClass( clusterID, provisionerSecret, namespace, pool, storageId string, ) *groupsnapapi.VolumeGroupSnapshotClass
func NewDefaultRbdSnapshotClass ¶
func NewDefaultRbdSnapshotClass( clusterID, provisionerSecret, namespace, storageId string, ) *snapapi.VolumeSnapshotClass
func NewDefaultRbdStorageClass ¶
func NewDefaultRbdStorageClass( clusterID, poolName, provisionerSecret, nodeSecret, namespace, storageId string, isDefaultStorageClass bool, ) *storagev1.StorageClass
func NewDefaultVirtRbdStorageClass ¶
func NewDefaultVirtRbdStorageClass( clusterID, poolName, provisionerSecret, nodeSecret, namespace, storageId string, isDefaultVirtStorageClass bool, ) *storagev1.StorageClass
func OwnersIndexFieldFunc ¶
func ReadEnvVar ¶
func RemoveExternalCephClusterNegativeConditions ¶
func RemoveExternalCephClusterNegativeConditions(conditions *[]conditionsv1.Condition)
RemoveExternalCephClusterNegativeConditions removes the External cluster negative conditions
func RestartPod ¶
func RestartPod(ctx context.Context, kubeClient client.Client, logger *logr.Logger, name string, namespace string)
RestartPod restarts the pod with the given name in the given namespace by deleting it and letting another one be created
func SetCompleteCondition ¶
func SetCompleteCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetCompleteCondition sets the ConditionReconcileComplete to True and other Conditions to indicate that the reconciliation process has completed successfully.
func SetErrorCondition ¶
func SetErrorCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetErrorCondition sets the ConditionReconcileComplete to False in case of any errors during the reconciliation process.
func SetProgressingCondition ¶
func SetProgressingCondition(conditions *[]conditionsv1.Condition, reason string, message string)
SetProgressingCondition sets the ProgressingCondition to True and other conditions to false or Unknown. Used when we are just starting to reconcile, and there are no existing conditions.
func SetVersionMismatchCondition ¶
func SetVersionMismatchCondition(conditions *[]conditionsv1.Condition, status corev1.ConditionStatus, reason string, message string)
SetVersionMismatchCondition sets the ConditionVersionMismatch to the status passed as argument, if the same status is not already present
func StorageClassFromExisting ¶
func StorageClassFromExisting( ctx context.Context, kubeClient client.Client, storageClassName string, consumer *ocsv1a1.StorageConsumer, consumerConfig StorageConsumerResources, rbdStorageId, cephFsStorageId, nfsStorageId string, ) (*storagev1.StorageClass, error)
func VolumeGroupSnapshotClassFromExisting ¶
func VolumeGroupSnapshotClassFromExisting( ctx context.Context, kubeClient client.Client, volumeGroupSnapshotClassName string, consumer *ocsv1a1.StorageConsumer, consumerConfig StorageConsumerResources, rbdStorageId, cephFsStorageId, nfsStorageId string, ) (*groupsnapapi.VolumeGroupSnapshotClass, error)
func VolumeSnapshotClassFromExisting ¶
func VolumeSnapshotClassFromExisting( ctx context.Context, kubeClient client.Client, volumeSnapshotClassName string, consumer *ocsv1a1.StorageConsumer, consumerConfig StorageConsumerResources, rbdStorageId, cephFsStorageId, nfsStorageId string, ) (*snapapi.VolumeSnapshotClass, error)
Types ¶
type AvailableServices ¶
func GetAvailableServices ¶
func GetAvailableServices(ctx context.Context, kubeClient client.Client, storageCluster *ocsv1.StorageCluster) (*AvailableServices, error)
type BackwardCompatabilityInfo ¶
type BackwardCompatabilityInfo struct {
Pre4_19InternalConsumer string `json:"pre4_19InternalConsumer"`
}
type Clusters ¶
type Clusters struct {
// contains filtered or unexported fields
}
func (*Clusters) AreOtherStorageClustersReady ¶
func (c *Clusters) AreOtherStorageClustersReady(instance *ocsv1.StorageCluster) bool
AreOtherStorageClustersReady checks if all other storage clusters (internal and external) are ready.
func (*Clusters) GetExternalStorageClusters ¶
func (c *Clusters) GetExternalStorageClusters() []ocsv1.StorageCluster
func (*Clusters) GetInternalStorageClusters ¶
func (c *Clusters) GetInternalStorageClusters() []ocsv1.StorageCluster
func (*Clusters) GetNamespacedNames ¶
func (*Clusters) GetNamespaces ¶
func (*Clusters) GetStorageClusters ¶
func (c *Clusters) GetStorageClusters() []ocsv1.StorageCluster
func (*Clusters) GetStorageClustersInNamespace ¶
func (c *Clusters) GetStorageClustersInNamespace(namespace string) []ocsv1.StorageCluster
func (*Clusters) HasMultipleStorageClustersInNamespace ¶
func (*Clusters) HasMultipleStorageClustersWithSameName ¶
func (*Clusters) IsExternalStorageClusterExist ¶
func (*Clusters) IsInternalAndExternalStorageClustersExist ¶
func (*Clusters) IsInternalStorageClusterExist ¶
type EventReporter ¶
type EventReporter struct {
// contains filtered or unexported fields
}
EventReporter is custom events reporter type which allows user to limit the events
func NewEventReporter ¶
func NewEventReporter(recorder record.EventRecorder) *EventReporter
NewEventReporter returns EventReporter object
func (*EventReporter) ReportIfNotPresent ¶
func (rep *EventReporter) ReportIfNotPresent(instance runtime.Object, eventType, eventReason, msg string)
ReportIfNotPresent will report event if lastReportedEvent is not the same in last 60 minutes
type GroupSnapshotterType ¶
type GroupSnapshotterType string
const ( RbdGroupSnapshotter GroupSnapshotterType = "rbd" CephfsGroupSnapshotter GroupSnapshotterType = "cephfs" )
type MetadataChangedPredicate ¶
MetadataChangedPredicate will only allow events that changed labels, annotations, or finalizers
func (MetadataChangedPredicate) Update ¶
func (p MetadataChangedPredicate) Update(e event.UpdateEvent) bool
Update implements the update event trap for StorageClusterChangedPredicate
type SnapshotterType ¶
type SnapshotterType string
SnapshotterType represents a snapshotter type
const ( RbdSnapshotter SnapshotterType = "rbd" CephfsSnapshotter SnapshotterType = "cephfs" NfsSnapshotter SnapshotterType = "nfs" )
type StorageConsumerResources ¶
type StorageConsumerResources interface { // Getters GetRbdRadosNamespaceName() string GetSubVolumeGroupName() string GetSubVolumeGroupRadosNamespaceName() string GetCsiRbdProvisionerCephUserName() string GetCsiRbdNodeCephUserName() string GetCsiCephFsProvisionerCephUserName() string GetCsiCephFsNodeCephUserName() string GetCsiNfsProvisionerCephUserName() string GetCsiNfsNodeCephUserName() string GetRbdClientProfileName() string GetCephFsClientProfileName() string GetNfsClientProfileName() string // Setters SetRbdRadosNamespaceName(string) SetSubVolumeGroupName(string) SetSubVolumeGroupRadosNamespaceName(string) SetCsiRbdProvisionerCephUserName(string) SetCsiRbdNodeCephUserName(string) SetCsiCephFsProvisionerCephUserName(string) SetCsiCephFsNodeCephUserName(string) SetCsiNfsProvisionerCephUserName(string) SetCsiNfsNodeCephUserName(string) SetRbdClientProfileName(string) SetCephFsClientProfileName(string) SetNfsClientProfileName(string) ReplaceRbdRadosNamespaceName(string) ReplaceSubVolumeGroupName(string) ReplaceSubVolumeGroupRadosNamespaceName(string) ReplaceCsiRbdProvisionerCephUserName(string) ReplaceCsiRbdNodeCephUserName(string) ReplaceCsiCephFsProvisionerCephUserName(string) ReplaceCsiCephFsNodeCephUserName(string) ReplaceCsiNfsProvisionerCephUserName(string) ReplaceCsiNfsNodeCephUserName(string) ReplaceRbdClientProfileName(string) ReplaceCephFsClientProfileName(string) ReplaceNfsClientProfileName(string) }
func WrapStorageConsumerResourceMap ¶
func WrapStorageConsumerResourceMap(data map[string]string) StorageConsumerResources