From 669e799d9f6312f9fd483de32f648d77176cefbe Mon Sep 17 00:00:00 2001
From: Max Kochubey <maxkochubey@gmail.com>
Date: Thu, 28 May 2020 05:13:47 +0700
Subject: [PATCH] [kibana] String/YAML conditions for
 `.Values.{extraContainers,extraInitContainers}` (#637)

---
 kibana/templates/deployment.yaml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml
index aca2ee153..9d7109265 100644
--- a/kibana/templates/deployment.yaml
+++ b/kibana/templates/deployment.yaml
@@ -69,8 +69,15 @@ spec:
 {{ toYaml .Values.imagePullSecrets | indent 8 }}
     {{- end }}
       {{- if .Values.extraInitContainers }}
+      # Currently some extra blocks accept strings
+      # to continue with backwards compatibility this is being kept
+      # whilst also allowing for yaml to be specified too.
       initContainers:
+      {{- if eq "string" (printf "%T" .Values.extraInitContainers) }}
 {{ tpl .Values.extraInitContainers . | indent 6 }}
+      {{- else }}
+{{ toYaml .Values.extraInitContainers | indent 6 }}
+      {{- end }}
       {{- end }}
       containers:
       - name: kibana
@@ -143,5 +150,12 @@ spec:
             subPath: {{ $path }}
           {{- end -}}
       {{- if .Values.extraContainers }}
+      # Currently some extra blocks accept strings
+      # to continue with backwards compatibility this is being kept
+      # whilst also allowing for yaml to be specified too.
+      {{- if eq "string" (printf "%T" .Values.extraContainers) }}
 {{ tpl .Values.extraContainers . | indent 6 }}
-      {{- end }}
\ No newline at end of file
+      {{- else }}
+{{ toYaml .Values.extraContainers | indent 6 }}
+      {{- end }}
+      {{- end }}