From 68e43efbfce0076fd23af8ec354fba48d4cf85a3 Mon Sep 17 00:00:00 2001 From: Julien Mailleret Date: Wed, 18 Dec 2019 15:28:31 +0100 Subject: [PATCH] [logstash] apply labels to all pods --- logstash/templates/statefulset.yaml | 3 +++ logstash/tests/logstash_test.py | 1 + 2 files changed, 4 insertions(+) diff --git a/logstash/templates/statefulset.yaml b/logstash/templates/statefulset.yaml index d21e90bc7..f953ec890 100644 --- a/logstash/templates/statefulset.yaml +++ b/logstash/templates/statefulset.yaml @@ -42,6 +42,9 @@ spec: chart: "{{ .Chart.Name }}" heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} annotations: {{- range $key, $value := .Values.podAnnotations }} {{ $key }}: {{ $value | quote }} diff --git a/logstash/tests/logstash_test.py b/logstash/tests/logstash_test.py index 33fb327f9..348fb3419 100755 --- a/logstash/tests/logstash_test.py +++ b/logstash/tests/logstash_test.py @@ -480,6 +480,7 @@ def test_adding_pod_labels(): ''' r = helm_template(config) assert r['statefulset'][name]['metadata']['labels']['app.kubernetes.io/name'] == 'logstash' + assert r['statefulset'][name]['spec']['template']['metadata']['labels']['app.kubernetes.io/name'] == 'logstash' def test_pod_security_policy():