Use lowercase in common.fullname during linting in helm3 03/112703/5
authorJakub Latusek <j.latusek@samsung.com>
Mon, 14 Sep 2020 14:39:43 +0000 (16:39 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Thu, 17 Sep 2020 11:36:33 +0000 (11:36 +0000)
Helm3 linting check if object name conform Kubernetes naming requirements

Change-Id: I03ac6f4c33048b59d495390a38f4adf6d3afa489
Signed-off-by: Jakub Latusek <j.latusek@samsung.com>
Issue-ID: OOM-2562

kubernetes/common/common/templates/_name.tpl

index e918cc1..adbe2b6 100644 (file)
 {{- $dot := default . .dot -}}
 {{- $suffix := default "" .suffix -}}
   {{- $name := default $dot.Chart.Name $dot.Values.nameOverride -}}
+  {{/* when linted, the name must be lower cased. When used from a component,
+       name should be overriden in order to avoid collision so no need to do it */}}
+  {{- if eq (printf "common/%s/templates" $name) $dot.Template.BasePath -}}
+  {{- $name = lower $name -}}
+  {{- end -}}
   {{- include "common.fullnameExplicit" (dict "dot" $dot "chartName" $name "suffix" $suffix) }}
 {{- end -}}