aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/common/templates
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-05-15 17:25:52 +0200
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2020-05-20 14:55:03 +0200
commit41cf72f18803970b7dfb91d2537dd35a4342ac36 (patch)
tree3677ee8dda56eb50eb4beabf489c9e50f05224a4 /kubernetes/common/common/templates
parenta7c75cde58bb300c3cec79e794a7f8e9d0778eaa (diff)
[COMMON] Templates for readiness
Create a template in order to have same readiness check everywhere. Issue-ID: OOM-1971 Signed-off-by: Sylvain Desbureaux <sylvain.desbureaux@orange.com> Change-Id: If3297184564a8e763110a79ff89eb07dfbc9e630
Diffstat (limited to 'kubernetes/common/common/templates')
-rw-r--r--kubernetes/common/common/templates/_utils.tpl (renamed from kubernetes/common/common/templates/_tplValue.tpl)13
1 files changed, 13 insertions, 0 deletions
diff --git a/kubernetes/common/common/templates/_tplValue.tpl b/kubernetes/common/common/templates/_utils.tpl
index b74ecbda19..ece786f49f 100644
--- a/kubernetes/common/common/templates/_tplValue.tpl
+++ b/kubernetes/common/common/templates/_utils.tpl
@@ -26,3 +26,16 @@ Usage:
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
+
+{{/*
+Retrieve values from the subchart, not from the main chart
+Usage:
+{{- $initRoot := default $dot.Values.subChartName .initRoot -}}
+{{ $subchartDot := fromJson (include "common.subChartDot" (dict "dot" . "initRoot" $initRoot)) }}
+*/}}
+{{- define "common.subChartDot" }}
+{{- $initRoot := .initRoot }}
+{{- $dot := .dot }}
+{{/* Our version of helm doesn't support deepCopy so we need this nasty trick */}}
+{{ mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) | toJson }}
+{{- end -}}