Skip to content

Commit 21827f4

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

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
operatorv1 "github.com/openshift/api/operator/v1"
3232
iov1 "github.com/openshift/api/operatoringress/v1"
3333
routev1 "github.com/openshift/api/route/v1"
34+
rbacv1 "k8s.io/api/rbac/v1"
3435

3536
configclientset "github.com/openshift/client-go/config/clientset/versioned"
3637
"github.com/openshift/cluster-ingress-operator/pkg/manifests"
@@ -236,6 +237,11 @@ func TestClusterOperatorStatusRelatedObjects(t *testing.T) {
236237
Resource: "namespaces",
237238
Name: "openshift-ingress-canary",
238239
},
240+
{
241+
Group: rbacv1.GroupName,
242+
Resource: "clusterroles",
243+
Name: "openshift-ingress-operator",
244+
},
239245
}
240246

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

0 commit comments

Comments
 (0)