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 #186 from elastic/so_persistent
Browse files Browse the repository at this point in the history
[elasticsearch] Fix pvc annotations with multiple fields
  • Loading branch information
Crazybus authored Jun 26, 2019
2 parents 34bf8c9 + 2d309cb commit 35e1b9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
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

0 comments on commit 35e1b9d

Please sign in to comment.