From 6734ab475e1af3937adf8d5a55629d52f2e721b1 Mon Sep 17 00:00:00 2001 From: "jeremy.hulick" Date: Tue, 26 Nov 2024 12:47:04 -0700 Subject: [PATCH] add common version label to daemonset pods Signed-off-by: jeremy.hulick --- charts/promtail/templates/_helpers.tpl | 10 ++++++++++ charts/promtail/templates/_pod.tpl | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/promtail/templates/_helpers.tpl b/charts/promtail/templates/_helpers.tpl index 8892e518c2..5e0d9da3e2 100644 --- a/charts/promtail/templates/_helpers.tpl +++ b/charts/promtail/templates/_helpers.tpl @@ -50,6 +50,16 @@ app.kubernetes.io/name: {{ include "promtail.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Pod labels +*/}} +{{- define "promtail.podLabels" -}} +{{ include "promtail.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +{{- end }} + {{/* Create the name of the namespace */}} diff --git a/charts/promtail/templates/_pod.tpl b/charts/promtail/templates/_pod.tpl index 6c75908bad..93f9d46aa9 100644 --- a/charts/promtail/templates/_pod.tpl +++ b/charts/promtail/templates/_pod.tpl @@ -4,7 +4,7 @@ Pod template used in Daemonset and Deployment {{- define "promtail.podTemplate" -}} metadata: labels: - {{- include "promtail.selectorLabels" . | nindent 4 }} + {{- include "promtail.podLabels" . | nindent 4 }} {{- with .Values.podLabels }} {{- toYaml . | nindent 4 }} {{- end }}