Skip to content

Commit 14bb378

Browse files
committed
OCPBUGS-65476: Add openshift-ingress-operator ClusterRole to ClusterOperator relatedObjects
Signed-off-by: Davide Salerno <[email protected]>
1 parent b62dd27 commit 14bb378

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

manifests/03-cluster-operator.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ status:
3030
- group: ingress.operator.openshift.io
3131
namespace: openshift-ingress-operator
3232
resource: dnsrecords
33+
- group: rbac.authorization.k8s.io
34+
name: openshift-ingress-operator
35+
resource: clusterroles

pkg/operator/controller/status/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/google/go-cmp/cmp/cmpopts"
1313
sailv1 "github.com/istio-ecosystem/sail-operator/api/v1"
1414
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
15+
rbacv1 "k8s.io/api/rbac/v1"
1516

1617
configv1 "github.com/openshift/api/config/v1"
1718
operatorv1 "github.com/openshift/api/operator/v1"
@@ -270,6 +271,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
270271
Resource: "dnsrecords",
271272
Namespace: r.config.Namespace,
272273
},
274+
{
275+
Group: rbacv1.GroupName,
276+
Resource: "clusterroles",
277+
Name: "openshift-ingress-operator",
278+
},
273279
}
274280
if state.IngressNamespace != nil {
275281
related = append(related, configv1.ObjectReference{

test/e2e/operator_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ func TestClusterOperatorStatusRelatedObjects(t *testing.T) {
236236
Resource: "namespaces",
237237
Name: "openshift-ingress-canary",
238238
},
239+
{
240+
Group: rbacv1.GroupName,
241+
Resource: "clusterroles",
242+
Name: "openshift-ingress-operator",
243+
},
239244
}
240245

241246
if gatewayAPIEnabled, err := isFeatureGateEnabled(features.FeatureGateGatewayAPI); err != nil {

0 commit comments

Comments
 (0)