Skip to content

Commit

Permalink
[Helm] Move collector service account template to separate collector … (
Browse files Browse the repository at this point in the history
  • Loading branch information
andriisoldatenko authored Jan 27, 2025
1 parent f00e14a commit cef9690
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
name: dynatrace-extensions-prometheus
namespace: {{ .Release.Namespace }}
labels:
{{- include "dynatrace-operator.extensionsOpenTelemetryCollectorLabels" . | nindent 4 }}
{{- include "dynatrace-operator.openTelemetryCollectorLabels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -66,13 +66,13 @@ metadata:
name: dynatrace-extensions-prometheus
namespace: {{ .Release.Namespace }}
labels:
{{- include "dynatrace-operator.extensionsOpenTelemetryCollectorLabels" . | nindent 4 }}
{{- include "dynatrace-operator.openTelemetryCollectorLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: dynatrace-extensions-prometheus
subjects:
- kind: ServiceAccount
name: dynatrace-extensions-collector
name: dynatrace-opentelemetry-collector
namespace: {{ .Release.Namespace }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: dynatrace-extensions-collector
name: dynatrace-opentelemetry-collector
namespace: {{ .Release.Namespace }}
{{- if .Values.rbac.extensions.annotations }}
annotations:
{{- toYaml .Values.rbac.extensions.annotations | nindent 4 }}
{{- end }}
labels:
{{- include "dynatrace-operator.extensionsOpenTelemetryCollectorLabels" . | nindent 4 }}
{{- include "dynatrace-operator.openTelemetryCollectorLabels" . | nindent 4 }}
{{ end }}
4 changes: 2 additions & 2 deletions config/helm/chart/default/templates/_labels.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ app.kubernetes.io/component: dynatrace-extensions-controller
{{- end -}}

{{/*
Extensions OpenTelemetry Collector (OTelC) labels
OpenTelemetry Collector (OTelC) labels
*/}}
{{- define "dynatrace-operator.extensionsOpenTelemetryCollectorLabels" -}}
{{- define "dynatrace-operator.openTelemetryCollectorLabels" -}}
{{ include "dynatrace-operator.commonLabels" . }}
app.kubernetes.io/component: dynatrace-extensions-collector
{{- end -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
suite: test clusterrole for the extensions OpenTelemetry collector
suite: test clusterrole for the dynatrace OpenTelemetry collector
templates:
- Common/extensions-opentelemetry-collector/clusterrole-extensions-opentelemetry-collector.yaml
- Common/extensions/clusterole-extensions-prometheus.yaml
tests:
- it: ClusterRole and ClusterRoleBinding exists
asserts:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
suite: test role for the extensions controller
templates:
- Common/extensions-controller/role-extensions-controller.yaml
- Common/extensions/role-extensions-controller.yaml
tests:
- it: should not exist by default
asserts:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
suite: test service account for extensions controller
templates:
- Common/extensions-controller/serviceaccount-extensions-controller.yaml
- Common/extensions/serviceaccount-extensions-controller.yaml
tests:
- it: should exist
set:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
suite: test service account for extensions OpenTelemetry collector
suite: test service account for dynatrace OpenTelemetry collector
templates:
- Common/extensions-opentelemetry-collector/serviceaccount-extensions-opentelemetry-collector.yaml
- Common/opentelemetry-collector/serviceaccount-opentelemetry-collector.yaml
tests:
- it: should exist
set:
Expand All @@ -10,7 +10,7 @@ tests:
of: ServiceAccount
- equal:
path: metadata.name
value: dynatrace-extensions-collector
value: dynatrace-opentelemetry-collector
- equal:
path: metadata.namespace
value: NAMESPACE
Expand Down

0 comments on commit cef9690

Please sign in to comment.