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

[elasticsearch] Fix pvc annotations with multiple fields #186

Merged
merged 1 commit into from
Jun 26, 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: 1 addition & 1 deletion elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
name: {{ template "uname" . }}
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{ toYaml .Values.volumeClaimTemplate | indent 6 }}
Expand Down
15 changes: 14 additions & 1 deletion elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,20 @@ def test_adding_storageclass_annotation_to_volumeclaimtemplate():
'''
r = helm_template(config)
annotations = r['statefulset'][uname]['spec']['volumeClaimTemplates'][0]['metadata']['annotations']
assert {'volume.beta.kubernetes.io/storage-class': 'id'} == annotations
assert annotations['volume.beta.kubernetes.io/storage-class'] == 'id'

def test_adding_multiple_persistence_annotations():
config = '''
persistence:
annotations:
hello: world
world: hello
'''
r = helm_template(config)
annotations = r['statefulset'][uname]['spec']['volumeClaimTemplates'][0]['metadata']['annotations']

assert annotations['hello'] == 'world'
assert annotations['world'] == 'hello'


def test_adding_a_secret_mount():
Expand Down