[incubator/vault] Fix setting serviceaccount label (#13371)

* set chart label based on the chart name and version

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* bump chart version

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* Add a vault.chart function that can be used to define labels

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* add scope

Signed-off-by: Janusz Bialy <jbialy@gmail.com>

* Bumping chart version

Signed-off-by: Matt Farina <matt@mattfarina.com>
This commit is contained in:
Janusz Bialy
2019-04-30 08:53:39 -07:00
committed by Kubernetes Prow Robot
parent 4ecc41158d
commit 75a5e1e2d7
7 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
description: A Helm chart for Vault, a tool for managing secrets
name: vault
version: 0.18.4
version: 0.18.5
appVersion: 1.0.1
home: https://www.vaultproject.io/
icon: https://www.vaultproject.io/assets/images/mega-nav/logo-vault-0f83e3d2.svg
+7
View File
@@ -29,3 +29,10 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vault.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
+1 -1
View File
@@ -7,7 +7,7 @@ metadata:
app: "{{ template "vault.name" . }}"
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ template "vault.chart" . }}"
data:
config.json: |
{{ .Values.vault.config | toJson }}
+1 -1
View File
@@ -4,7 +4,7 @@ metadata:
name: {{ template "vault.fullname" . }}
labels:
app: {{ template "vault.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "vault.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.labels }}
+1 -1
View File
@@ -7,7 +7,7 @@ metadata:
name: {{ template "vault.fullname" . }}
labels:
app: {{ template "vault.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
chart: "{{ template "vault.chart" . }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- if .Values.ingress.labels }}
+1 -1
View File
@@ -4,7 +4,7 @@ metadata:
name: {{ template "vault.fullname" . }}
labels:
app: {{ template "vault.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
chart: {{ template "vault.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.service.annotations }}
@@ -5,7 +5,7 @@ metadata:
name: {{ template "vault.serviceAccountName" . }}
labels:
app: {{ template "vault.name" . }}
chart: {{ template "vault.chart" . }}
chart: "{{ template "vault.chart" . }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- end -}}