Add extraLabels for Vault server serviceAccount (#806)

This commit is contained in:
Aleksandr Titov 2022-11-03 04:01:35 +03:00 committed by GitHub
parent 46e6fb5ad1
commit ab5b471c27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 0 deletions

View file

@ -1,5 +1,8 @@
## Unreleased
Features:
* server: Add `extraLabels` for Vault server serviceAccount [GH-806](https://github.com/hashicorp/vault-helm/pull/806)
## 0.22.1 (October 26th, 2022)
Changes:

View file

@ -10,5 +10,8 @@ metadata:
app.kubernetes.io/name: {{ include "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.server.serviceAccount.extraLabels -}}
{{- toYaml .Values.server.serviceAccount.extraLabels | nindent 4 -}}
{{- end -}}
{{ template "vault.serviceAccount.annotations" . }}
{{ end }}

View file

@ -117,3 +117,13 @@ load _helpers
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
}
@test "server/serviceAccount: specify server.serviceAccount.extraLabels" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/server-serviceaccount.yaml \
--set 'server.serviceAccount.extraLabels.foo=bar' \
. | tee /dev/stderr |
yq -r '.metadata.labels.foo' | tee /dev/stderr)
[ "${actual}" = "bar" ]
}

View file

@ -851,6 +851,9 @@ server:
# YAML or a YAML-formatted multi-line templated string map of the
# annotations to apply to the serviceAccount.
annotations: {}
# Extra labels to attach to the serviceAccount
# This should be a YAML map of the labels to apply to the serviceAccount
extraLabels: {}
# Settings for the statefulSet used to run Vault.
statefulSet: