Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move collector service account template to separate collector … #4312

Merged
merged 9 commits into from
Jan 27, 2025
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
Loading