Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions manifests/0000_70_dns-operator_03-cluster-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ status:
versions:
- name: operator
version: "0.0.1-snapshot"
relatedObjects:
- group: rbac.authorization.k8s.io
resource: clusterroles
name: openshift-dns-operator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we add clusterrolebindings and serviceaccount as well?

    - group: rbac.authorization.k8s.io
      name: openshift-dns-operator
      resource: clusterrolebindings
    - group: ""
      name: dns-operator
      namespace: openshift-dns-operator
      resource: serviceaccounts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked to the reporter

- group: rbac.authorization.k8s.io
name: dns-operator
resource: clusterrolebindings
6 changes: 6 additions & 0 deletions pkg/operator/controller/status/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
rbacv1 "k8s.io/api/rbac/v1"

configv1 "github.com/openshift/api/config/v1"
operatorv1 "github.com/openshift/api/operator/v1"
Expand Down Expand Up @@ -136,6 +137,11 @@ func (r *reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
Resource: "dnses",
Name: "default",
},
{
Group: rbacv1.GroupName,
Resource: "clusterroles",
Name: "openshift-dns-operator",
},
}
if state.haveNamespace {
related = append(related, configv1.ObjectReference{
Expand Down
10 changes: 10 additions & 0 deletions test/e2e/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ func TestClusterOperatorStatusRelatedObjects(t *testing.T) {
Resource: "namespaces",
Name: "openshift-dns",
},
{
Group: rbacv1.GroupName,
Resource: "clusterroles",
Name: "openshift-dns-operator",
},
{
Group: rbacv1.GroupName,
Resource: "clusterrolebindings",
Name: "dns-operator",
},
}
err = wait.PollImmediate(1*time.Second, 5*time.Minute, func() (bool, error) {
co := &configv1.ClusterOperator{}
Expand Down