From: Maciej Wereski Date: Mon, 4 Oct 2021 13:44:38 +0000 (+0200) Subject: [COMMON] Log: add ability to set ConfigMap name in volumes X-Git-Tag: 9.0.0~48^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=oom.git;a=commitdiff_plain;h=77ecf276763ba23eddcd05bedefed3b6da3bd7ea [COMMON] Log: add ability to set ConfigMap name in volumes 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 Change-Id: Ieed19d46e4205cd5b23b4c74af19c618a6e48466 --- diff --git a/kubernetes/common/common/templates/_log.tpl b/kubernetes/common/common/templates/_log.tpl index dc714aecc4..81420468b0 100644 --- a/kubernetes/common/common/templates/_log.tpl +++ b/kubernetes/common/common/templates/_log.tpl @@ -31,10 +31,12 @@ {{- 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 -}}