From 4f5c449074e9d7fbc120d740c498ef77ceefad28 Mon Sep 17 00:00:00 2001 From: Jared Allard Date: Wed, 15 Aug 2018 13:21:20 -0700 Subject: [PATCH] fix(stable/vault-operator): empty svc account name (#6729) * fix(stable/vault-operator): empty svc account name Documented name is `vault-operator-sa`, but in the `values.yaml` it is empty. :scream_cat: * chorestable/vault-operator): bump to 0.1.1 * fix: use vault-operator.serviceAccountName over hardcoded, dont pollute the global template namespace --- stable/vault-operator/Chart.yaml | 2 +- stable/vault-operator/templates/_helpers.tpl | 4 ++-- stable/vault-operator/templates/deployment.yaml | 2 +- stable/vault-operator/templates/role-binding.yaml | 2 +- stable/vault-operator/templates/service-account.yaml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stable/vault-operator/Chart.yaml b/stable/vault-operator/Chart.yaml index 2b7d85d65f..f341d26372 100644 --- a/stable/vault-operator/Chart.yaml +++ b/stable/vault-operator/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: CoreOS vault-operator Helm chart for Kubernetes name: vault-operator -version: 0.1.0 +version: 0.1.1 appVersion: 0.1.9 home: https://github.com/coreos/vault-operator icon: https://s3.amazonaws.com/hashicorp-marketing-web-assets/brand/Vault_VerticalLogo_FullColor.B1xPC0pSax.svg diff --git a/stable/vault-operator/templates/_helpers.tpl b/stable/vault-operator/templates/_helpers.tpl index 621b2d75b8..421d88c7e2 100644 --- a/stable/vault-operator/templates/_helpers.tpl +++ b/stable/vault-operator/templates/_helpers.tpl @@ -34,10 +34,10 @@ Create chart name and version as used by the chart label. {{/* Create the name of the service account to use */}} -{{- define "serviceAccountName" -}} +{{- define "vault-operator.serviceAccountName" -}} {{- if .Values.serviceAccount.create -}} {{ default (include "vault-operator.fullname" .) .Values.serviceAccount.name }} {{- else -}} {{ default "default" .Values.serviceAccount.name }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/stable/vault-operator/templates/deployment.yaml b/stable/vault-operator/templates/deployment.yaml index f90a42d44a..df4a47bd52 100644 --- a/stable/vault-operator/templates/deployment.yaml +++ b/stable/vault-operator/templates/deployment.yaml @@ -19,7 +19,7 @@ spec: app: {{ template "vault-operator.name" . }} release: {{ .Release.Name }} spec: - serviceAccountName: {{ template "serviceAccountName" . }} + serviceAccountName: {{ template "vault-operator.serviceAccountName" . }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/stable/vault-operator/templates/role-binding.yaml b/stable/vault-operator/templates/role-binding.yaml index 325ffa353d..481d75a3b1 100644 --- a/stable/vault-operator/templates/role-binding.yaml +++ b/stable/vault-operator/templates/role-binding.yaml @@ -10,7 +10,7 @@ metadata: heritage: {{ .Release.Service }} subjects: - kind: ServiceAccount - name: {{ template "serviceAccountName" . }} + name: {{ template "vault-operator.serviceAccountName" . }} namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/stable/vault-operator/templates/service-account.yaml b/stable/vault-operator/templates/service-account.yaml index 68ac51f498..383ab59264 100644 --- a/stable/vault-operator/templates/service-account.yaml +++ b/stable/vault-operator/templates/service-account.yaml @@ -3,10 +3,10 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ .Values.serviceAccount.name }} + name: {{ template "vault-operator.serviceAccountName" . }} labels: app: {{ template "vault-operator.name" . }} chart: {{ template "vault-operator.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} -{{- end }} \ No newline at end of file +{{- end }}