Skip to content

Commit 4a05978

Browse files
nammnfealebenpae
authored andcommitted
telemetry: always install binding and if potentially skip role (#4165)
# Summary - rolebinding has unique namespaced name and can always be installed - role is unique and should be skipped if configured that way ## Proof of Work ``` (venv) ~/projects/ops-manager-kubernetes git:[fix-helm-chart] helm template operator-2 helm_chart --set operator.telemetry.installClusterRole=false | rg clusterVersion # ClusterRoleBinding for clusterVersionDetection (venv) ~/projects/ops-manager-kubernetes git:[fix-helm-chart] helm template operator-2 helm_chart| rg clusterVersion # Additional ClusterRole for clusterVersionDetection # ClusterRoleBinding for clusterVersionDetection ``` ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [ ] Have you checked whether your jira ticket required DOCSP changes? - [ ] Have you checked for release_note changes? ## Reminder (Please remove this when merging) - Please try to Approve or Reject Changes the PR, keep PRs in review as short as possible - Our Short Guide for PRs: [Link](REDACTED) - Remember the following Communication Standards - use comment prefixes for clarity: * **blocking**: Must be addressed before approval. * **follow-up**: Can be addressed in a later PR or ticket. * **q**: Clarifying question. * **nit**: Non-blocking suggestions. * **note**: Side-note, non-actionable. Example: Praise * --> no prefix is considered a question
1 parent 6cc7bd4 commit 4a05978

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

config/rbac/operator-roles.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
# Source: enterprise-operator/templates/operator-roles.yaml
3+
---
34
# Additional ClusterRole for clusterVersionDetection
45
kind: ClusterRole
56
apiVersion: rbac.authorization.k8s.io/v1
@@ -28,7 +29,6 @@ rules:
2829
- list
2930
---
3031
# Source: enterprise-operator/templates/operator-roles.yaml
31-
---
3232
# ClusterRoleBinding for clusterVersionDetection
3333
kind: ClusterRoleBinding
3434
apiVersion: rbac.authorization.k8s.io/v1

helm_chart/templates/operator-roles.yaml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,7 @@ subjects:
185185
{{/* We can't use default here, as 0, false and nil as determined as unset and thus set the default value */}}
186186
{{- if ne $telemetry.enabled false }}
187187
{{- if ne $telemetry.installClusterRole false}}
188-
---
189-
# ClusterRoleBinding for clusterVersionDetection
190-
kind: ClusterRoleBinding
191-
apiVersion: rbac.authorization.k8s.io/v1
192-
metadata:
193-
name: {{ .Values.operator.name }}-{{ include "mongodb-enterprise-operator.namespace" . }}-cluster-telemetry-binding
194-
roleRef:
195-
apiGroup: rbac.authorization.k8s.io
196-
kind: ClusterRole
197-
name: {{ $clusterRoleName }}
198-
subjects:
199-
- kind: ServiceAccount
200-
name: {{ .Values.operator.name }}
201-
namespace: {{ include "mongodb-enterprise-operator.namespace" . }}
202-
{{- end }}
188+
203189
---
204190
# Additional ClusterRole for clusterVersionDetection
205191
kind: ClusterRole
@@ -228,3 +214,18 @@ rules:
228214
verbs:
229215
- list
230216
{{- end}}
217+
---
218+
# ClusterRoleBinding for clusterVersionDetection
219+
kind: ClusterRoleBinding
220+
apiVersion: rbac.authorization.k8s.io/v1
221+
metadata:
222+
name: {{ .Values.operator.name }}-{{ include "mongodb-enterprise-operator.namespace" . }}-cluster-telemetry-binding
223+
roleRef:
224+
apiGroup: rbac.authorization.k8s.io
225+
kind: ClusterRole
226+
name: {{ $clusterRoleName }}
227+
subjects:
228+
- kind: ServiceAccount
229+
name: {{ .Values.operator.name }}
230+
namespace: {{ include "mongodb-enterprise-operator.namespace" . }}
231+
{{- end }}

0 commit comments

Comments
 (0)