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 #383 from tanakapayam/tanakapayam/elasticsearch-po…
Browse files Browse the repository at this point in the history
…d-labels

[elasticsearch] Apply labels to all pods
  • Loading branch information
jmlrt authored Nov 22, 2019
2 parents f2c8815 + b9757da commit 2226073
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions elasticsearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ spec:
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}"
app: "{{ template "uname" . }}"
{{- range $key, $value := .Values.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
Expand Down
5 changes: 3 additions & 2 deletions elasticsearch/tests/elasticsearch_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def test_adding_a_label_on_non_headless_service():
r = helm_template(config)

assert 'label1' not in r['service'][uname]['metadata']['labels']

config = '''
service:
labels:
Expand All @@ -699,7 +699,7 @@ def test_adding_a_label_on_headless_service():
r = helm_template(config)

assert 'label1' not in r['service'][uname + '-headless']['metadata']['labels']

config = '''
service:
labelsHeadless:
Expand Down Expand Up @@ -847,6 +847,7 @@ def test_adding_pod_labels():
'''
r = helm_template(config)
assert r['statefulset'][uname]['metadata']['labels']['app.kubernetes.io/name'] == 'elasticsearch'
assert r['statefulset'][uname]['spec']['template']['metadata']['labels']['app.kubernetes.io/name'] == 'elasticsearch'

def test_keystore_enable():
config = ''
Expand Down

0 comments on commit 2226073

Please sign in to comment.