Documentation ¶
Index ¶
- Constants
- func AddAnnotation(obj metav1.Object, key string, value string) bool
- func AddLabel(obj metav1.Object, key string, value string) bool
- func AddLabels(obj metav1.Object, newLabels map[string]string)
- func Find[T any](list []T, f func(item *T) bool) *T
- func GetOperatorNamespace() string
- func GetTolerationForCSIPods() corev1.Toleration
- func ValidateOperatorNamespace() error
- func ValidateStausReporterImage() error
- type EventReporter
Constants ¶
const ( // EventReasonValidationFailed is used when the StorageCluster spec validation fails EventReasonValidationFailed = "FailedValidation" // EventReasonUninstallPending is used when the StorageCluster uninstall is Pending EventReasonUninstallPending = "UninstallPending" )
const DesiredSubscriptionChannelAnnotationKey = "ocs.openshift.io/subscription.channel"
Value corresponding to annotation key has subscription channel
const OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"
OperatorNamespaceEnvVar is the constant for env variable OPERATOR_NAMESPACE which is the namespace where operator pod is deployed.
const OperatorPodNameEnvVar = "OPERATOR_POD_NAME"
OperatorPodNameEnvVar is the constant for env variable OPERATOR_POD_NAME
const StatusReporterImageEnvVar = "STATUS_REPORTER_IMAGE"
const StorageClientNameEnvVar = "STORAGE_CLIENT_NAME"
StorageClientNameEnvVar is the constant for env variable STORAGE_CLIENT_NAME
Variables ¶
This section is empty.
Functions ¶
func AddAnnotation ¶
AddAnnotation adds an annotation to a resource metadata, returns true if added else false
func AddLabels ¶
AddLabels adds values from newLabels to the keys on the supplied obj or overwrites values for existing keys on the obj
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the namespace where the operator is deployed.
func GetTolerationForCSIPods ¶
func GetTolerationForCSIPods() corev1.Toleration
func ValidateOperatorNamespace ¶
func ValidateOperatorNamespace() error
func ValidateStausReporterImage ¶
func ValidateStausReporterImage() error
Types ¶
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