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

use same imagePullPolicy in initContainer #350

Merged
merged 1 commit into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,15 @@ spec:
runAsUser: 0
privileged: true
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
command: ["sysctl", "-w", "vm.max_map_count={{ .Values.sysctlVmMaxMapCount}}"]
resources:
{{ toYaml .Values.initResources | indent 10 }}
{{- end }}
{{ if .Values.keystore }}
- name: keystore
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
command:
- sh
- -c
Expand Down
26 changes: 26 additions & 0 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,19 @@ def test_sysctl_init_container_enabled():
initContainers = r['statefulset'][uname]['spec']['template']['spec']['initContainers']
assert initContainers[0]['name'] == 'configure-sysctl'

def test_sysctl_init_container_image():
config = '''
image: customImage
imageTag: 6.2.4
imagePullPolicy: Never
sysctlInitContainer:
enabled: true
'''
r = helm_template(config)
initContainers = r['statefulset'][uname]['spec']['template']['spec']['initContainers']
assert initContainers[0]['image'] == 'customImage:6.2.4'
assert initContainers[0]['imagePullPolicy'] == 'Never'

def test_adding_storageclass_annotation_to_volumeclaimtemplate():
config = '''
persistence:
Expand Down Expand Up @@ -870,6 +883,19 @@ def test_keystore_init_container():

assert i['name'] == 'keystore'

def test_keystore_init_container_image():
config = '''
image: customImage
imageTag: 6.2.4
imagePullPolicy: Never
keystore:
- secretName: test
'''
r = helm_template(config)
i = r['statefulset'][uname]['spec']['template']['spec']['initContainers'][-1]
assert i['image'] == 'customImage:6.2.4'
assert i['imagePullPolicy'] == 'Never'

def test_keystore_mount():
config = '''
keystore:
Expand Down