fix(helm): add trimSuffix to helper functions

pull/1635/head
John Hofman 8 years ago
parent aec6c50708
commit c38fb120bf

@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{define "name"}}{{default "nginx" .Values.nameOverride | trunc 24 }}{{end}}
{{define "name"}}{{default "nginx" .Values.nameOverride | trunc 24 | trimSuffix "-" }}{{end}}
{{/*
Create a default fully qualified app name.
@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}}
{{define "fullname"}}
{{- $name := default "nginx" .Values.nameOverride -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{end}}

@ -162,7 +162,7 @@ const defaultHelpers = `{{/* vim: set filetype=mustache: */}}
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}}
{{- end -}}
{{/*
@ -171,7 +171,7 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{- end -}}
`

@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{define "name"}}{{default "nginx" .Values.nameOverride | trunc 24 }}{{end}}
{{define "name"}}{{default "nginx" .Values.nameOverride | trunc 24 | trimSuffix "-" }}{{end}}
{{/*
Create a default fully qualified app name.
@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}}
{{define "fullname"}}
{{- $name := default "nginx" .Values.nameOverride -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{end}}

Loading…
Cancel
Save