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

[elasticsearch] Apply labels to all pods #383

Merged
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
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