From e5e719a50dc70125fb075e25d4f337c093824e52 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Wed, 10 Jul 2024 07:52:49 +0530 Subject: [PATCH] fix: selector label error --- chart/templates/_helpers.tpl | 6 ++++-- chart/templates/deployment.yaml | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/chart/templates/_helpers.tpl b/chart/templates/_helpers.tpl index d75310e0..6c2c48a0 100644 --- a/chart/templates/_helpers.tpl +++ b/chart/templates/_helpers.tpl @@ -36,8 +36,10 @@ Selector labels app.kubernetes.io/name: {{ include "config-db.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} control-plane: {{ include "config-db.name" . }} -{{- if .Values.global.labels }} +{{- end }} + +{{- define "config-db.extraLabels" -}} +{{- if .Values.global.labels -}} {{.Values.global.labels | toYaml}} {{- end }} {{- end }} - diff --git a/chart/templates/deployment.yaml b/chart/templates/deployment.yaml index 0f7cde87..37352512 100644 --- a/chart/templates/deployment.yaml +++ b/chart/templates/deployment.yaml @@ -8,7 +8,9 @@ kind: Deployment {{- end }} metadata: name: {{ include "config-db.name" . }} - labels: {{- include "config-db.labels" . | nindent 4 }} + labels: + {{- include "config-db.labels" . | nindent 4 }} + {{- include "config-db.extraLabels" . | nindent 4 }} spec: replicas: {{ .Values.replicas }} revisionHistoryLimit: 1 @@ -32,7 +34,9 @@ spec: {{- end }} template: metadata: - labels: {{- include "config-db.selectorLabels" . | nindent 8 }} + labels: + {{- include "config-db.selectorLabels" . | nindent 8 }} + {{- include "config-db.extraLabels" . | nindent 8 }} spec: serviceAccountName: {{ template "config-db.serviceAccountName" . }} securityContext: