Documentation ¶
Index ¶
- Constants
- func AddAnnotation(obj metav1.Object, key string, value string) bool
- func AddAnnotations(obj metav1.Object, newAnnotations map[string]string)
- func AddLabel(obj metav1.Object, key string, value string) bool
- func AddLabels(obj metav1.Object, newLabels map[string]string)
- func AssertEqual[T comparable](actual T, expected T, exitCode int)
- func CreateOrReplace(ctx context.Context, c client.Client, obj client.Object, ...) error
- func EventTypePredicate(create, update, del, generic bool) predicate.Predicate
- func Find[T any](list []T, f func(item *T) bool) *T
- func GetClusterResourceQuotaName(name string) string
- func GetMD5Hash(text string) string
- func GetNoobaaOperatorChannel() string
- func GetOperatorNamespace() string
- func NamePredicate(name string) predicate.Predicate
- 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 ( // OperatorNamespaceEnvVar is the constant for env variable OPERATOR_NAMESPACE // which is the namespace where operator pod is deployed. OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE" // OperatorPodNameEnvVar is the constant for env variable OPERATOR_POD_NAME OperatorPodNameEnvVar = "OPERATOR_POD_NAME" // StorageClientNameEnvVar is the constant for env variable STORAGE_CLIENT_NAME StorageClientNameEnvVar = "STORAGE_CLIENT_NAME" StatusReporterImageEnvVar = "STATUS_REPORTER_IMAGE" // Value corresponding to annotation key has subscription channel DesiredSubscriptionChannelAnnotationKey = "ocs.openshift.io/subscription.channel" // Value corresponding to annotation key has desired client hash DesiredConfigHashAnnotationKey = "ocs.openshift.io/provider-side-state" CronScheduleWeekly = "@weekly" ExitCodeThatShouldRestartTheProcess = 42 OcsClientTimeout = 10 * time.Second )
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 AssertEqual ¶
func AssertEqual[T comparable](actual T, expected T, exitCode int)
func CreateOrReplace ¶
func EventTypePredicate ¶
EventTypePredicate return a predicate the 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 then a single event type
func GetMD5Hash ¶
func GetNoobaaOperatorChannel ¶
func GetNoobaaOperatorChannel() string
func GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the namespace where the operator is deployed.
func NamePredicate ¶
Name Predicate return a predicate the filter events produced by resources that matches the given name
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