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

Commit

Permalink
Merge pull request #350 from maedadev/master
Browse files Browse the repository at this point in the history
use same imagePullPolicy in initContainer
  • Loading branch information
jmlrt committed Oct 31, 2019
2 parents 727012e + 63ada77 commit 7308c81
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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

0 comments on commit 7308c81

Please sign in to comment.