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 EventTypePredicate(create, update, del, generic bool) predicate.Predicate
- func Filter[T any](s []T, predicate func(*T) bool) []T
- func Find[T any](list []T, f func(item *T) bool) *T
- func GetClusterResourceQuotaName(name string) string
- func GetMD5Hash(text string) string
- func GetOperatorNamespace() string
- func GetOperatorPodName() (string, error)
- func GetWatchNamespace() string
- func IsForbiddenError(err error) bool
- func NamePredicate(name string) predicate.Predicate
- func RemoveAnnotation(obj metav1.Object, key string) bool
- func SetClusterInformation(ctx context.Context, kubeClient client.Client, ...) error
- func ValidateOperatorNamespace() error
- func ValidateStausReporterImage() error
Constants ¶
View Source
const ( // OperatorNamespaceEnvVar is the constant for env variable OPERATOR_NAMESPACE // which is the namespace where operator pod is deployed. OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE" // WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE // which indicates any other namespace to watch for resources. WatchNamespaceEnvVar = "WATCH_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" TopologyDomainLabelsAnnotationKey = "ocs.openshift.io/csi-rbd-topology-domain-labels" CronScheduleWeekly = "@weekly" ExitCodeThatShouldRestartTheProcess = 42 OcsClientTimeout = 10 * time.Second OperatorVersionEnvVar = "OPERATOR_VERSION" )
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 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 GetOperatorNamespace ¶
func GetOperatorNamespace() string
GetOperatorNamespace returns the namespace where the operator is deployed.
func GetOperatorPodName ¶
func GetWatchNamespace ¶
func GetWatchNamespace() string
func IsForbiddenError ¶
func NamePredicate ¶
Name Predicate return a predicate the filter events produced by resources that matches the given name
func SetClusterInformation ¶
func SetClusterInformation( ctx context.Context, kubeClient client.Client, status interfaces.StorageClientInfo, ) error
func ValidateOperatorNamespace ¶
func ValidateOperatorNamespace() error
func ValidateStausReporterImage ¶
func ValidateStausReporterImage() error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.