From 103253e5d9c2bfe6ae4e5df05f0ca06b77434dc3 Mon Sep 17 00:00:00 2001 From: Davide Salerno Date: Fri, 28 Nov 2025 16:17:29 +0100 Subject: [PATCH] OCPBUGS-65476: Add openshift-ingress-operator ClusterRole to ClusterOperator relatedObjects Signed-off-by: Davide Salerno --- manifests/03-cluster-operator.yaml | 3 +++ pkg/operator/controller/status/controller.go | 6 ++++++ test/e2e/operator_test.go | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/manifests/03-cluster-operator.yaml b/manifests/03-cluster-operator.yaml index bdbe6faa5d..e0781ac1a2 100644 --- a/manifests/03-cluster-operator.yaml +++ b/manifests/03-cluster-operator.yaml @@ -30,3 +30,6 @@ status: - group: ingress.operator.openshift.io namespace: openshift-ingress-operator resource: dnsrecords + - group: rbac.authorization.k8s.io + name: openshift-ingress-operator + resource: clusterroles diff --git a/pkg/operator/controller/status/controller.go b/pkg/operator/controller/status/controller.go index fc1d94e3b9..e3dd2b0140 100644 --- a/pkg/operator/controller/status/controller.go +++ b/pkg/operator/controller/status/controller.go @@ -12,6 +12,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" sailv1 "github.com/istio-ecosystem/sail-operator/api/v1" operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + rbacv1 "k8s.io/api/rbac/v1" configv1 "github.com/openshift/api/config/v1" operatorv1 "github.com/openshift/api/operator/v1" @@ -270,6 +271,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) ( Resource: "dnsrecords", Namespace: r.config.Namespace, }, + { + Group: rbacv1.GroupName, + Resource: "clusterroles", + Name: "openshift-ingress-operator", + }, } if state.IngressNamespace != nil { related = append(related, configv1.ObjectReference{ diff --git a/test/e2e/operator_test.go b/test/e2e/operator_test.go index 3ac4c01c96..6099715847 100644 --- a/test/e2e/operator_test.go +++ b/test/e2e/operator_test.go @@ -31,6 +31,7 @@ import ( operatorv1 "github.com/openshift/api/operator/v1" iov1 "github.com/openshift/api/operatoringress/v1" routev1 "github.com/openshift/api/route/v1" + rbacv1 "k8s.io/api/rbac/v1" configclientset "github.com/openshift/client-go/config/clientset/versioned" "github.com/openshift/cluster-ingress-operator/pkg/manifests" @@ -223,6 +224,11 @@ func TestClusterOperatorStatusRelatedObjects(t *testing.T) { Resource: "dnsrecords", Namespace: operatorNamespace, }, + { + Group: rbacv1.GroupName, + Resource: "clusterroles", + Name: "openshift-ingress-operator", + }, { Resource: "namespaces", Name: "openshift-ingress",