From 4ee25693f5de57b5ae7bc8f0ae167a7fc2cd4835 Mon Sep 17 00:00:00 2001 From: Yonatan Kahana Date: Thu, 13 May 2021 20:54:36 +0300 Subject: [PATCH] Use podLabels with user defined labels in deployment pod template Signed-off-by: Yonatan Kahana --- charts/nfs-subdir-external-provisioner/Chart.yaml | 2 +- .../templates/_helpers.tpl | 10 ++++++++++ .../templates/deployment.yaml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/nfs-subdir-external-provisioner/Chart.yaml b/charts/nfs-subdir-external-provisioner/Chart.yaml index 609562c9..a6547ab6 100644 --- a/charts/nfs-subdir-external-provisioner/Chart.yaml +++ b/charts/nfs-subdir-external-provisioner/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 4.0.2 description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes. name: nfs-subdir-external-provisioner home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner -version: 4.0.10 +version: 4.0.11 kubeVersion: ">=1.9.0-0" sources: - https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner diff --git a/charts/nfs-subdir-external-provisioner/templates/_helpers.tpl b/charts/nfs-subdir-external-provisioner/templates/_helpers.tpl index 4b9d8fa7..c6c4f79f 100644 --- a/charts/nfs-subdir-external-provisioner/templates/_helpers.tpl +++ b/charts/nfs-subdir-external-provisioner/templates/_helpers.tpl @@ -73,6 +73,16 @@ heritage: {{ .Release.Service }} {{- end }} {{- end }} +{{/* +Pod template labels +*/}} +{{- define "nfs-subdir-external-provisioner.podLabels" -}} +{{ include "nfs-subdir-external-provisioner.selectorLabels" . }} +{{- with .Values.labels }} +{{- toYaml . | nindent 0 }} +{{- end }} +{{- end }} + {{/* Selector labels */}} diff --git a/charts/nfs-subdir-external-provisioner/templates/deployment.yaml b/charts/nfs-subdir-external-provisioner/templates/deployment.yaml index 6999b748..34f161c5 100644 --- a/charts/nfs-subdir-external-provisioner/templates/deployment.yaml +++ b/charts/nfs-subdir-external-provisioner/templates/deployment.yaml @@ -21,7 +21,7 @@ spec: scheduler.alpha.kubernetes.io/tolerations: '{{ toJson .Values.tolerations }}' {{- end }} labels: - {{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 8 }} + {{- include "nfs-subdir-external-provisioner.podLabels" . | nindent 8 }} spec: serviceAccountName: {{ template "nfs-subdir-external-provisioner.serviceAccountName" . }} {{- if .Values.nodeSelector }}