Skip to content

Commit

Permalink
Add automountServiceAccountToken: true to fullstack OA serviceAccount (
Browse files Browse the repository at this point in the history
  • Loading branch information
0sewa0 authored Dec 9, 2024
1 parent 2d2f1d9 commit 0b6cc5e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ metadata:
{{- end }}
labels:
{{- include "dynatrace-operator.oneagentLabels" . | nindent 4 }}
automountServiceAccountToken: false
automountServiceAccountToken: {{.Values.rbac.logMonitoring.create}}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ suite: test serviceaccount for oneagent
templates:
- Common/oneagent/serviceaccount-oneagent.yaml
tests:
- it: should exist
- it: should exist on kubernetes
set:
platform: kubernetes
asserts:
Expand All @@ -16,8 +16,7 @@ tests:
value: NAMESPACE
- isNull:
path: imagePullSecrets

- it: should exist
- it: should exist on openshift
set:
platform: openshift
asserts:
Expand All @@ -26,9 +25,9 @@ tests:
- equal:
path: metadata.name
value: dynatrace-dynakube-oneagent

- it: should exist
- it: should add user annotations
set:
rbac.oneAgent.create: true
rbac.oneAgent.annotations:
test: test
asserts:
Expand All @@ -44,3 +43,23 @@ tests:
asserts:
- hasDocuments:
count: 0
- it: should have automountServiceAccountToken set to TRUE, incase of log-monitoring is available
set:
rbac.oneAgent.create: true
rbac.logMonitoring.create: true
asserts:
- isKind:
of: ServiceAccount
- equal:
path: automountServiceAccountToken
value: true
- it: should have automountServiceAccountToken set to FALSE, incase of log-monitoring is NOT available
set:
rbac.oneAgent.create: true
rbac.logMonitoring.create: false
asserts:
- isKind:
of: ServiceAccount
- equal:
path: automountServiceAccountToken
value: false

0 comments on commit 0b6cc5e

Please sign in to comment.