From 8155f184225a4d4a8a0e11fb6d03d9fee8537472 Mon Sep 17 00:00:00 2001 From: Mike Elliott Date: Thu, 19 Apr 2018 11:37:37 -0400 Subject: [PATCH] Add chart name override to service name tpl See issue id for details. Change-Id: Iea807608f7bd315a28032b640f3aa9370adc17eb Issue-ID: OOM-971 Signed-off-by: Mike Elliott --- kubernetes/common/common/templates/_service.tpl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kubernetes/common/common/templates/_service.tpl b/kubernetes/common/common/templates/_service.tpl index 25e373a7c9..77b77d059a 100644 --- a/kubernetes/common/common/templates/_service.tpl +++ b/kubernetes/common/common/templates/_service.tpl @@ -17,8 +17,8 @@ {{/* Resolve the name of a chart's service. - The default will be the chart name, unless - overridden in the service configuration. + The default will be the chart name (or .Values.nameOverride if set). + And the use of .Values.service.name overrides all. - .Values.service.name : override default service (ie. chart) name */}} @@ -26,5 +26,6 @@ Expand the service name for a chart. */}} {{- define "common.servicename" -}} - {{- default .Chart.Name .Values.service.name | trunc 63 | trimSuffix "-" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- default $name .Values.service.name | trunc 63 | trimSuffix "-" -}} {{- end -}} \ No newline at end of file -- 2.16.6