Update the 'fullname' template to match helm 2.8.2

The newer 'fullname' helper function automatically avoids name duplication. This change updates the function in cert-manager to include that functionality.

Given there is generally only one cert-manager per cluster, if you install cert-manager and call it `cert-manager`:
```
helm upgrade --install cert-manager stable/cert-manager
```
You get deployments and pods called `cert-manager-cert-manager...` 

With the update  version (taken from the `helm create` template for helm 2.8.2` you instead get deployments and pods called `cert-manager`.

There is a workaround possible at the moment, but the automatic behavior is more intuitive for new users.
```
helm upgrade --install cert-manager stable/cert-manager --set=fullnameOverride=cert-manager
```
This commit is contained in:
Aaron Roydhouse 2018-05-22 10:36:53 -04:00
parent c61f392163
commit e9e3ee2e6a

View File

@ -11,9 +11,16 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "cert-manager.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- $fullname := printf "%s-%s" $name .Release.Name -}}
{{- default $fullname .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*