Commit 1360e320 authored by Matt Butcher's avatar Matt Butcher Committed by GitHub

Merge pull request #1635 from johnhofman/fix/helper-template-trimSuffix

fix(helm): add trimSuffix to helper functions
parents 6f891ea8 c38fb120
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. 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. 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 ...@@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}} */}}
{{define "fullname"}} {{define "fullname"}}
{{- $name := default "nginx" .Values.nameOverride -}} {{- $name := default "nginx" .Values.nameOverride -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 -}} {{printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{end}} {{end}}
...@@ -162,7 +162,7 @@ const defaultHelpers = `{{/* vim: set filetype=mustache: */}} ...@@ -162,7 +162,7 @@ const defaultHelpers = `{{/* vim: set filetype=mustache: */}}
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "name" -}} {{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} {{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/* {{/*
...@@ -171,7 +171,7 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this ...@@ -171,7 +171,7 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}} */}}
{{- define "fullname" -}} {{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}} {{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} {{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
` `
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. 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. 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 ...@@ -12,5 +12,5 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this
*/}} */}}
{{define "fullname"}} {{define "fullname"}}
{{- $name := default "nginx" .Values.nameOverride -}} {{- $name := default "nginx" .Values.nameOverride -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 -}} {{printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}}
{{end}} {{end}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment