Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[6.8] ES Statefulset empty initContainers fix (#795) (#941)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Mailleret <8582351+jmlrt@users.noreply.github.com>

Co-authored-by: cloudziu <cloudziu@o2.pl>
  • Loading branch information
jmlrt and cloudziu committed Nov 26, 2020
1 parent e6d7af9 commit f15a6be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ spec:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
enableServiceLinks: {{ .Values.enableServiceLinks }}
{{- if or (.Values.extraInitContainers) (.Values.sysctlInitContainer.enabled) (.Values.keystore) }}
initContainers:
{{- if .Values.sysctlInitContainer.enabled }}
- name: configure-sysctl
Expand Down Expand Up @@ -210,6 +211,7 @@ spec:
{{ tpl .Values.extraInitContainers . | indent 6 }}
{{- else }}
{{ toYaml .Values.extraInitContainers | indent 6 }}
{{- end }}
{{- end }}
{{- end }}
containers:
Expand Down
5 changes: 1 addition & 4 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,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():
Expand Down

0 comments on commit f15a6be

Please sign in to comment.