[stable/external-dns] Update helper functions to follow best practice (#12607)

* [stable/external-dns] Update helper functions to follow best practice

The recommended helper function created by `helm create` now avoids the double naming situation
when the release name contains chart name. It also adds `fullnameOverride` value, so the fullname
could be overridden.
This commit updates `external-dns` chart to work the same way.

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>

* [stable/external-dns] Bump chart version

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
This commit is contained in:
Mikhail Zholobov
2019-03-28 02:44:45 -07:00
committed by Kubernetes Prow Robot
parent 8bd37cf62e
commit 779ebe271a
2 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ description: |
Configure external DNS servers (AWS Route53, Google CloudDNS and others)
for Kubernetes Ingresses and Services
name: external-dns
version: 1.7.0
version: 1.7.1
appVersion: 0.5.9
home: https://github.com/kubernetes-incubator/external-dns
sources:
+10 -5
View File
@@ -9,13 +9,18 @@ Expand the name of the chart.
{{/*
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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "external-dns.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if ne $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -43,4 +48,4 @@ role_arn = {{ .Values.aws.roleArn }}
{{- end }}
region = {{ .Values.aws.region }}
source_profile = default
{{ end }}
{{ end }}