Add chart name override to service name tpl 49/43749/1
authorMike Elliott <mike.elliott@amdocs.com>
Thu, 19 Apr 2018 15:37:37 +0000 (11:37 -0400)
committerMike Elliott <mike.elliott@amdocs.com>
Thu, 19 Apr 2018 15:37:37 +0000 (11:37 -0400)
See issue id for details.

Change-Id: Iea807608f7bd315a28032b640f3aa9370adc17eb
Issue-ID: OOM-971
Signed-off-by: Mike Elliott <mike.elliott@amdocs.com>
kubernetes/common/common/templates/_service.tpl

index 25e373a..77b77d0 100644 (file)
@@ -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