From 9ce278a80d640c6b5b91ca2135b1a421cd1eb684 Mon Sep 17 00:00:00 2001 From: Cloudziu Date: Fri, 21 Aug 2020 11:02:01 +0200 Subject: [PATCH 1/2] ES Statefulset empty initContainers fix --- elasticsearch/templates/statefulset.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elasticsearch/templates/statefulset.yaml b/elasticsearch/templates/statefulset.yaml index 6cc70377a..edaec4496 100644 --- a/elasticsearch/templates/statefulset.yaml +++ b/elasticsearch/templates/statefulset.yaml @@ -157,7 +157,9 @@ spec: {{- if semverCompare ">1.13" .Capabilities.KubeVersion.GitVersion }} enableServiceLinks: {{ .Values.enableServiceLinks }} {{- end }} + {{- if or (.Values.extraInitContainers) (.Values.sysctlInitContainer.enabled) (.Values.keystore) }} initContainers: + {{- end }} {{- if .Values.sysctlInitContainer.enabled }} - name: configure-sysctl securityContext: From a03c13d82ea69ed0ae8da7928cb2b745833b2ee0 Mon Sep 17 00:00:00 2001 From: Julien Mailleret <8582351+jmlrt@users.noreply.github.com> Date: Tue, 24 Nov 2020 15:51:10 +0100 Subject: [PATCH 2/2] fix test --- elasticsearch/tests/elasticsearch_test.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/elasticsearch/tests/elasticsearch_test.py b/elasticsearch/tests/elasticsearch_test.py index 6ceec27db..ac2a58c1e 100755 --- a/elasticsearch/tests/elasticsearch_test.py +++ b/elasticsearch/tests/elasticsearch_test.py @@ -371,10 +371,7 @@ def test_sysctl_init_container_disabled(): enabled: false """ r = helm_template(config) - initContainers = r["statefulset"][uname]["spec"]["template"]["spec"][ - "initContainers" - ] - assert initContainers is None + assert "initContainers" not in r["statefulset"][uname]["spec"]["template"]["spec"] def test_sysctl_init_container_enabled():