Merge "[COMMON] Allow to generate fullname based on passed chart name"
authorBorislav Glozman <Borislav.Glozman@amdocs.com>
Sun, 2 Feb 2020 13:15:34 +0000 (13:15 +0000)
committerGerrit Code Review <gerrit@onap.org>
Sun, 2 Feb 2020 13:15:34 +0000 (13:15 +0000)
kubernetes/common/common/templates/_name.tpl

index 9b7e690..7719cdb 100644 (file)
   {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
 {{- end -}}
 
+{{/*
+  The same as common.full name but based on passed dictionary instead of trying to figure
+  out chart name on its own.
+*/}}
+{{- define "common.fullnameExplicit" -}}
+  {{- $dot := .dot }}
+  {{- $name := .chartName }}
+  {{- printf "%s-%s" (include "common.release" $dot) $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
 {{/*
   Create a default fully qualified application name.
   Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
 */}}
 {{- define "common.fullname" -}}
   {{- $name := default .Chart.Name .Values.nameOverride -}}
-  {{- printf "%s-%s" (include "common.release" .) $name | trunc 63 | trimSuffix "-" -}}
+  {{- include "common.fullnameExplicit" (dict "dot" . "chartName" $name) }}
 {{- end -}}
 
 {{/*