Commit b0d4cacd authored by z00358552's avatar z00358552

fix(helm) change name length limit to 63 for `helm create`

since kubernetes 1.4, the upper limit for resource name is 63 characters,
so it is better to change the template when running `helm create` accordingly.
parent 5a33f462
...@@ -162,16 +162,16 @@ const defaultHelpers = `{{/* vim: set filetype=mustache: */}} ...@@ -162,16 +162,16 @@ 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 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/* {{/*
Create a default fully qualified app name. Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}} */}}
{{- define "fullname" -}} {{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}} {{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
` `
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{define "name"}}{{default "nginx" .Values.nameOverride | trunc 24 | trimSuffix "-" }}{{end}} {{define "name"}}{{default "nginx" .Values.nameOverride | trunc 63 | trimSuffix "-" }}{{end}}
{{/* {{/*
Create a default fully qualified app name. Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this We truncate at 63 chars because some Kubernetes name fields are limited to this
(by the DNS naming spec). (by the DNS naming spec).
*/}} */}}
{{define "fullname"}} {{define "fullname"}}
{{- $name := default "nginx" .Values.nameOverride -}} {{- $name := default "nginx" .Values.nameOverride -}}
{{printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} {{printf "%s-%s" .Release.Name $name | trunc 63 | 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