Skip to content

Commit

Permalink
Merge pull request #277 from whereisaaron/master
Browse files Browse the repository at this point in the history
The newer 'fullname' go template recommended by `helm create` avoids doubling up on the release/chart name. So it avoids `helm install --name stash stable/stash` leading to resources called `stash-stash-...`. Instead they are called just `stash-...`.

https://github.com/kubernetes/helm/blob/7c79d1c76534074d5708eae2c5ef88ae044941db/pkg/chartutil/create.go#L237-L249
  • Loading branch information
tamalsaha authored Jan 5, 2018
2 parents fac516a + ae8e801 commit 001d159
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chart/stable/stash/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
*/}}
{{- define "stash.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" $name .Release.Name | trunc 63 -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

0 comments on commit 001d159

Please sign in to comment.