summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2021-12-09 21:21:37 +0100
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-12-14 15:45:59 +0000
commitd36040c282c2d9747e6c678c0dc2d524b530c093 (patch)
treec6977b322ca25a1babdacdc0b1a98d3b1439c3ea
parent370c6dc33e55bfee7b3b79bcc21481b02a3f1e24 (diff)
[COMMON] Make our common charts compatible with helm 3.7+
Helm 3.7.0 introduced a new .Chart variable named IsRoot. In the same time they refactored the representation of .Chart and it no longer is a dictionary but a structure which confuses mergeOverride. In order to keep our tricks working we need to skip .Chart while doing a deepCopy of our current context. Issue-ID: OOM-1 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Change-Id: I230e2ba460ddf09377d8de6c1366d4fd82f764cd
-rw-r--r--kubernetes/common/certInitializer/templates/_certInitializer.yaml2
-rw-r--r--kubernetes/common/common/templates/_utils.tpl3
2 files changed, 2 insertions, 3 deletions
diff --git a/kubernetes/common/certInitializer/templates/_certInitializer.yaml b/kubernetes/common/certInitializer/templates/_certInitializer.yaml
index 32bba457ee..ecd7129567 100644
--- a/kubernetes/common/certInitializer/templates/_certInitializer.yaml
+++ b/kubernetes/common/certInitializer/templates/_certInitializer.yaml
@@ -183,7 +183,7 @@
{{- define "common.certInitializer._volumes" -}}
{{- $dot := default . .dot -}}
{{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
-{{- $subchartDot := mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) }}
+{{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot))}}
- name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
emptyDir:
medium: Memory
diff --git a/kubernetes/common/common/templates/_utils.tpl b/kubernetes/common/common/templates/_utils.tpl
index ece786f49f..52826c2bd2 100644
--- a/kubernetes/common/common/templates/_utils.tpl
+++ b/kubernetes/common/common/templates/_utils.tpl
@@ -36,6 +36,5 @@ Usage:
{{- 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 }}
+{{ mergeOverwrite (deepCopy (omit $dot "Values" "Chart")) (dict "Chart" (set (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Version" $dot.Chart.Version) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) | toJson }}
{{- end -}}