From 060b82ffca8b2d31998fb3c466e74f3e21cc0fee Mon Sep 17 00:00:00 2001 From: AshutoshNirkhe Date: Thu, 16 Jun 2022 10:42:12 +0530 Subject: [PATCH] Fix _helpers.tpl function for ambassador.name, issue #4282 Signed-off-by: AshutoshNirkhe --- charts/emissary-ingress/templates/_helpers.tpl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/emissary-ingress/templates/_helpers.tpl b/charts/emissary-ingress/templates/_helpers.tpl index 35bb757918..5b08c04148 100644 --- a/charts/emissary-ingress/templates/_helpers.tpl +++ b/charts/emissary-ingress/templates/_helpers.tpl @@ -3,10 +3,12 @@ Expand the name of the chart. */}} {{- define "ambassador.name" -}} -{{- if contains "ambassador" .Release.Name -}} +{{- if .Values.nameOverride -}} +{{- .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- else if contains "ambassador" .Release.Name -}} {{- .Release.Name | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- .Chart.Name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}}