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 @@ -15,10 +15,10 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: dynatrace-extensions-prometheus
name: dynatrace-opentelemetry-prometheus
StefanHauth marked this conversation as resolved.
Show resolved Hide resolved
namespace: {{ .Release.Namespace }}
labels:
{{- include "dynatrace-operator.extensionsOpenTelemetryCollectorLabels" . | nindent 4 }}
{{- include "dynatrace-operator.openTelemetryCollectorLabels" . | nindent 4 }}
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -63,16 +63,16 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dynatrace-extensions-prometheus
name: dynatrace-opentelemetry-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
name: dynatrace-opentelemetry-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 }}
6 changes: 3 additions & 3 deletions config/helm/chart/default/templates/_labels.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ 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
app.kubernetes.io/component: dynatrace-opentelemetry-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/opentelemetry-collector/clusterrole-opentelemetry-collector.yaml
tests:
- it: ClusterRole and ClusterRoleBinding exists
asserts:
Expand All @@ -14,7 +14,7 @@ tests:
of: ClusterRole
- equal:
path: metadata.name
value: dynatrace-extensions-prometheus
value: dynatrace-opentelemetry-prometheus
- isNotEmpty:
path: metadata.labels
- isNotEmpty:
Expand Down Expand Up @@ -66,7 +66,7 @@ tests:
of: ClusterRole
- equal:
path: metadata.name
value: dynatrace-extensions-prometheus
value: dynatrace-opentelemetry-prometheus
- isNotEmpty:
path: metadata.labels
- contains:
Expand All @@ -87,7 +87,7 @@ tests:
of: ClusterRoleBinding
- equal:
path: metadata.name
value: dynatrace-extensions-prometheus
value: dynatrace-opentelemetry-prometheus
- isNotEmpty:
path: metadata.labels

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