Skip to content

Commit

Permalink
[incubator/vault] Fix setting serviceaccount label (helm#13371)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
jbialy authored and k8s-ci-robot committed Apr 30, 2019
1 parent 4ecc411 commit 75a5e1e
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion incubator/vault/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 7 additions & 0 deletions incubator/vault/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 1 addition & 1 deletion incubator/vault/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion incubator/vault/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion incubator/vault/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion incubator/vault/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion incubator/vault/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

0 comments on commit 75a5e1e

Please sign in to comment.