Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDataHash(dataObject interface{}) (string, error)
- func DetermineOpenShiftVersion(client client.Client) (string, error)
- func FindStatusCondition(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) *odfv1alpha1.Condition
- func GeneratePoolConfigmapContent(sp ScPoolMap) (string, error)
- func GetExporterImage() (string, error)
- func GetLabels(clusterName string) map[string]string
- func GetWatchNamespace() (string, error)
- func InitK8sEvent(instance *odfv1alpha1.FlashSystemCluster, eventtype, reason, message string) *corev1.Event
- func IsContain(slice []string, s string) bool
- func IsStatusConditionFalse(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) bool
- func IsStatusConditionPresentAndEqual(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType, ...) bool
- func IsStatusConditionTrue(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) bool
- func Remove(slice []string, s string) (result []string)
- func RemoveStatusCondition(conditions *[]odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType)
- func SetReconcileCompleteCondition(conditions *[]odfv1alpha1.Condition, reason string, message string)
- func SetReconcileErrorCondition(conditions *[]odfv1alpha1.Condition, reason string, message string)
- func SetReconcileProgressingCondition(conditions *[]odfv1alpha1.Condition, reason string, message string)
- func SetStatusCondition(conditions *[]odfv1alpha1.Condition, newCondition odfv1alpha1.Condition)
- type ScPoolMap
Constants ¶
const ( // SuccessfulCreateBlockCSIReason is added in an event when Block CSI // is successfully launched. SuccessfulLaunchBlockCSIReason = "SuccessfulLaunchBlockCSI" FailedLaunchBlockCSIReason = "FailedLaunchBlockCSI" SuccessfulDetectBlockCSIReason = "SuccessfulDetectBlockCSI" FailedLaunchBlockExporterReason = "FailedLaunchBlockExporter" FailedCreateServiceReason = "FailedCreateService" FailedCreateServiceMonitorReason = "FailedCreateServiceMonitor" FailedCreateStorageClassReason = "FailedCreateStorageClass" DeletedDuplicatedStorageClassReason = "DeletedDuplicatedStorageClass" FailedCreatePromRuleReason = "FailedCreatePromRule" )
Reasons for ibm storage odf events
const ( PoolConfigmapName = "ibm-flashsystem-pools" PoolConfigmapMountPath = "/config" PoolConfigmapKey = "pools" CsiIBMBlockDriver = "block.csi.ibm.com" CsiIBMBlockScPool = "pool" )
const ExporterImageEnvVar = "EXPORTER_IMAGE"
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"
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.
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" )
Functions ¶
func CalculateDataHash ¶
CalculateDataHash generates a sha256 hex-digest for a data object
func DetermineOpenShiftVersion ¶ added in v1.0.0
func FindStatusCondition ¶
func FindStatusCondition(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) *odfv1alpha1.Condition
FindStatusCondition finds the conditionType in conditions.
func GetExporterImage ¶
GetExporterImage returns the exporter image from operator env by OLM bundle
func GetWatchNamespace ¶
GetWatchNamespace returns the namespace the operator should be watching for changes
func InitK8sEvent ¶ added in v1.0.0
func InitK8sEvent(instance *odfv1alpha1.FlashSystemCluster, eventtype, reason, message string) *corev1.Event
func IsStatusConditionFalse ¶
func IsStatusConditionFalse(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) bool
IsStatusConditionFalse returns true when the conditionType is present and set to `corev1.ConditionFalse`
func IsStatusConditionPresentAndEqual ¶
func IsStatusConditionPresentAndEqual(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType, status corev1.ConditionStatus) bool
IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status.
func IsStatusConditionTrue ¶
func IsStatusConditionTrue(conditions []odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType) bool
IsStatusConditionTrue returns true when the conditionType is present and set to `corev1.ConditionTrue`
func RemoveStatusCondition ¶
func RemoveStatusCondition(conditions *[]odfv1alpha1.Condition, conditionType odfv1alpha1.ConditionType)
RemoveStatusCondition removes the corresponding conditionType from conditions.
func SetReconcileCompleteCondition ¶
func SetReconcileCompleteCondition(conditions *[]odfv1alpha1.Condition, reason string, message string)
SetCompleteCondition sets the ConditionReconcileComplete to True and other Conditions to indicate that the reconciliation process has completed successfully.
func SetReconcileErrorCondition ¶
func SetReconcileErrorCondition(conditions *[]odfv1alpha1.Condition, reason string, message string)
SetErrorCondition sets the ConditionReconcileComplete to False in case of any errors during the reconciliation process.
func SetReconcileProgressingCondition ¶
func SetReconcileProgressingCondition(conditions *[]odfv1alpha1.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 SetStatusCondition ¶
func SetStatusCondition(conditions *[]odfv1alpha1.Condition, newCondition odfv1alpha1.Condition)
SetStatusCondition sets the corresponding condition in conditions to newCondition.