From b9d80b33544f2b80217e1a226692ccf78bc239a8 Mon Sep 17 00:00:00 2001 From: Deavon McCaffery Date: Mon, 4 Nov 2019 23:57:10 +0000 Subject: [PATCH] fix(elastic): fix kibana full name override NOTES: The kibana chart did not respect the `fullnameOverride` in the template helpers despite including fullNameOverride in the values.yaml. This resolves that issue. See: https://github.com/elastic/helm-charts/pull/330#issuecomment-549600471 --- charts/elastic/kibana/templates/_helpers.tpl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/charts/elastic/kibana/templates/_helpers.tpl b/charts/elastic/kibana/templates/_helpers.tpl index a5254f4..04fa056 100644 --- a/charts/elastic/kibana/templates/_helpers.tpl +++ b/charts/elastic/kibana/templates/_helpers.tpl @@ -9,10 +9,19 @@ 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 "fullname" -}} -{{- $name := default .Release.Name .Values.nameOverride -}} -{{- printf "%s-%s" $name .Chart.Name | trunc 63 | trimSuffix "-" -}} +{{- define "helm-operator.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $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 -}} {{/*