Skip to content

Commit

Permalink
Merge pull request #53 from DataDog/vboulineau/operator-fixed-sa
Browse files Browse the repository at this point in the history
Fix name of serviceAccount used in Deployment if serviceAccount.name is set
  • Loading branch information
vboulineau authored Sep 28, 2020
2 parents a5c6e4c + 3e3c4b3 commit b58be64
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions charts/datadog-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.2

* Fix name of serviceAccount used in Deployment if serviceAccount.name is set

## 0.1.1

* Add automatic README.md generation from `Values.yaml`
Expand Down
2 changes: 1 addition & 1 deletion charts/datadog-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: datadog-operator
version: 0.1.1
version: 0.1.2
appVersion: 0.3.1
description: Datadog Operator
keywords:
Expand Down
4 changes: 2 additions & 2 deletions charts/datadog-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Datadog Operator

![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: 0.3.1](https://img.shields.io/badge/AppVersion-0.3.1-informational?style=flat-square)
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![AppVersion: 0.3.1](https://img.shields.io/badge/AppVersion-0.3.1-informational?style=flat-square)

## Values

Expand All @@ -22,6 +22,6 @@
| resources | object | `{}` | Set resources requests/limits for Datadog Operator PODs |
| secretBackend.command | string | `""` | Specifies the path to the command that implements the secret backend api |
| serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
| serviceAccount.name | string | `nil` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| serviceAccount.name | string | `nil` | The name of the service account to use. If not set name is generated using the fullname template |
| supportExtendedDaemonset | string | `"false"` | If true, supports using ExtendedDeamonSet CRD |
| tolerations | list | `[]` | Allows to schedule Datadog Operator on tainted nodes |
6 changes: 1 addition & 5 deletions charts/datadog-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,5 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
Create the name of the service account to use
*/}}
{{- define "datadog-operator.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "datadog-operator.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{ default (include "datadog-operator.fullname" .) .Values.serviceAccount.name }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/datadog-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "datadog-operator.fullname" . }}
serviceAccountName: {{ include "datadog-operator.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
3 changes: 1 addition & 2 deletions charts/datadog-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ rbac:
serviceAccount:
# serviceAccount.create -- Specifies whether a service account should be created
create: true
# serviceAccount.name -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
# serviceAccount.name -- The name of the service account to use. If not set name is generated using the fullname template
name:
# resources -- Set resources requests/limits for Datadog Operator PODs
resources: {}
Expand Down

0 comments on commit b58be64

Please sign in to comment.