Skip to content

Commit 98a37ae

Browse files
committed
OCPBUGS-65498: Add openshift-dns-operator ClusterRole to ClusterOperator relatedObjects
Signed-off-by: Davide Salerno <[email protected]>
1 parent 41a53fe commit 98a37ae

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

manifests/0000_70_dns-operator_03-cluster-operator.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ status:
1313
versions:
1414
- name: operator
1515
version: "0.0.1-snapshot"
16+
relatedObjects:
17+
- group: rbac.authorization.k8s.io
18+
resource: clusterroles
19+
name: openshift-dns-operator
20+
- group: rbac.authorization.k8s.io
21+
name: dns-operator
22+
resource: clusterrolebindings

pkg/operator/controller/status/controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/google/go-cmp/cmp"
99
"github.com/google/go-cmp/cmp/cmpopts"
10+
rbacv1 "k8s.io/api/rbac/v1"
1011

1112
configv1 "github.com/openshift/api/config/v1"
1213
operatorv1 "github.com/openshift/api/operator/v1"
@@ -136,6 +137,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
136137
Resource: "dnses",
137138
Name: "default",
138139
},
140+
{
141+
Group: rbacv1.GroupName,
142+
Resource: "clusterroles",
143+
Name: "openshift-dns-operator",
144+
},
139145
}
140146
if state.haveNamespace {
141147
related = append(related, configv1.ObjectReference{

test/e2e/operator_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ func TestClusterOperatorStatusRelatedObjects(t *testing.T) {
127127
Resource: "namespaces",
128128
Name: "openshift-dns",
129129
},
130+
{
131+
Group: rbacv1.GroupName,
132+
Resource: "clusterroles",
133+
Name: "openshift-dns-operator",
134+
},
135+
{
136+
Group: rbacv1.GroupName,
137+
Resource: "clusterrolebindings",
138+
Name: "dns-operator",
139+
},
130140
}
131141
err = wait.PollImmediate(1*time.Second, 5*time.Minute, func() (bool, error) {
132142
co := &configv1.ClusterOperator{}

0 commit comments

Comments
 (0)