From 4d36986d946a08e3c9c16aafd1fd7d8abb43577c Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Wed, 6 Nov 2024 13:31:49 +0530 Subject: [PATCH] add generated changes Signed-off-by: Rewant Soni --- config/rbac/role.yaml | 6 ++++++ deploy/csv-templates/ocs-operator.csv.yaml.in | 6 ++++++ .../manifests/ocs-operator.clusterserviceversion.yaml | 6 ++++++ .../ocs-operator/v4/controllers/util/k8sutil.go | 1 + .../ocs-operator/v4/controllers/util/predicates.go | 9 +++++++++ 5 files changed, 28 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 37b26d8457..aa6b9b559b 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -122,6 +122,12 @@ rules: - patch - update - watch +- apiGroups: + - "" + resources: + - configmaps/finalizers + verbs: + - update - apiGroups: - "" resources: diff --git a/deploy/csv-templates/ocs-operator.csv.yaml.in b/deploy/csv-templates/ocs-operator.csv.yaml.in index e9bf5cc09c..df799f2c78 100644 --- a/deploy/csv-templates/ocs-operator.csv.yaml.in +++ b/deploy/csv-templates/ocs-operator.csv.yaml.in @@ -293,6 +293,12 @@ spec: - patch - update - watch + - apiGroups: + - "" + resources: + - configmaps/finalizers + verbs: + - update - apiGroups: - "" resources: diff --git a/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml b/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml index 2547e7ca2d..5176786e22 100644 --- a/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml +++ b/deploy/ocs-operator/manifests/ocs-operator.clusterserviceversion.yaml @@ -302,6 +302,12 @@ spec: - patch - update - watch + - apiGroups: + - "" + resources: + - configmaps/finalizers + verbs: + - update - apiGroups: - "" resources: diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/k8sutil.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/k8sutil.go index 87103da9d1..b39d304dcb 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/k8sutil.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/k8sutil.go @@ -49,6 +49,7 @@ const ( OdfInfoNamespacedNameClaimName = "odfinfo.odf.openshift.io" ExitCodeThatShouldRestartTheProcess = 42 + CephBlockPoolForbidMirroringLabel = "ocs.openshift.io/forbid-mirroring" ) var podNamespace = os.Getenv(PodNamespaceEnvVar) diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/predicates.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/predicates.go index aaf5c16662..ce51d1d4a2 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/predicates.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/v4/controllers/util/predicates.go @@ -3,6 +3,7 @@ package util import ( "fmt" "reflect" + "strings" "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/client" @@ -81,6 +82,14 @@ func NamePredicate(name string) predicate.Predicate { }) } +// Prefix Name Predicate return a predicate the filter events produced +// by resources that matches the given suffix name +func PrefixNamePredicate(name string) predicate.Predicate { + return predicate.NewPredicateFuncs(func(obj client.Object) bool { + return strings.HasPrefix(obj.GetName(), name) + }) +} + func CrdCreateAndDeletePredicate(log *logr.Logger, crdName string, crdExists bool) predicate.Predicate { return predicate.Funcs{ CreateFunc: func(_ event.CreateEvent) bool {