utils

package
v0.0.0-...-484006e Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventReasonValidationFailed is used when the StorageCluster spec validation fails
	EventReasonValidationFailed = "FailedValidation"

	// EventReasonUninstallPending is used when the StorageCluster uninstall is Pending
	EventReasonUninstallPending = "UninstallPending"
)
View Source
const DesiredSubscriptionChannelAnnotationKey = "ocs.openshift.io/subscription.channel"

Value corresponding to annotation key has subscription channel

View Source
const OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"

OperatorNamespaceEnvVar is the constant for env variable OPERATOR_NAMESPACE which is the namespace where operator pod is deployed.

View Source
const OperatorPodNameEnvVar = "OPERATOR_POD_NAME"

OperatorPodNameEnvVar is the constant for env variable OPERATOR_POD_NAME

View Source
const StatusReporterImageEnvVar = "STATUS_REPORTER_IMAGE"
View Source
const StorageClientNameEnvVar = "STORAGE_CLIENT_NAME"

StorageClientNameEnvVar is the constant for env variable STORAGE_CLIENT_NAME

Variables

This section is empty.

Functions

func AddAnnotation

func AddAnnotation(obj metav1.Object, key string, value string) bool

AddAnnotation adds an annotation to a resource metadata, returns true if added else false

func AddLabel

func AddLabel(obj metav1.Object, key string, value string) bool

AddAnnotation adds label to a resource metadata, returns true if added else false

func AddLabels

func AddLabels(obj metav1.Object, newLabels map[string]string)

AddLabels adds values from newLabels to the keys on the supplied obj or overwrites values for existing keys on the obj

func Find

func Find[T any](list []T, f func(item *T) bool) *T

Find returns the first entry matching the function "f" or else return nil

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL