[COMMON] Log: add ability to set ConfigMap name in volumes 70/124670/12
authorMaciej Wereski <m.wereski@partner.samsung.com>
Mon, 4 Oct 2021 13:44:38 +0000 (15:44 +0200)
committerSylvain Desbureaux <sylvain.desbureaux@orange.com>
Fri, 29 Oct 2021 14:11:53 +0000 (14:11 +0000)
In case where subchart uses ConfigMap that was defined in parent chart,
wrong chart name will be generated. This change allows to workaround
that issue by supplying own prefix instead of generated one.

Issue-ID: OOM-1
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Change-Id: Ieed19d46e4205cd5b23b4c74af19c618a6e48466

kubernetes/common/common/templates/_log.tpl

index dc714ae..8142046 100644 (file)
 {{- end -}}
 
 {{- define "common.log.volumes" -}}
-{{- if .Values.global.centralizedLoggingEnabled }}
+{{- $dot := default . .dot }}
+{{- if $dot.Values.global.centralizedLoggingEnabled }}
+{{- $configMapName := printf "%s-filebeat" (default (include "common.fullname" $dot) .configMapNamePrefix) }}
 - name: filebeat-conf
   configMap:
-    name: {{ include "common.fullname" . }}-filebeat
+    name: {{ $configMapName }}
 - name: filebeat-data
   emptyDir: {}
 {{- end -}}