From 41ef875c557d8cc0251a1d203011328e12034fa5 Mon Sep 17 00:00:00 2001 From: Akash Shrivastava Date: Tue, 24 Sep 2024 14:00:27 +0530 Subject: [PATCH] feat: [PL-56708]: adding service labels in PDB (#128) Signed-off-by: Akash Shrivastava --- src/common/Chart.yaml | 2 +- src/common/templates/_pdb.tpl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index 189a47a..744727a 100644 --- a/src/common/Chart.yaml +++ b/src/common/Chart.yaml @@ -15,7 +15,7 @@ type: library # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.59 +version: 1.3.60 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/src/common/templates/_pdb.tpl b/src/common/templates/_pdb.tpl index fee9f53..68abbc9 100644 --- a/src/common/templates/_pdb.tpl +++ b/src/common/templates/_pdb.tpl @@ -6,13 +6,15 @@ Usage example: {{- define "harnesscommon.pdb.renderPodDistributionBudget" -}} {{- $ := .ctx }} {{- if or $.Values.global.pdb.create $.Values.pdb.create }} +{{- $labelsFunction := printf "%s.labels" (default $.Chart.Name $.Values.nameOverride) }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ default $.Chart.Name $.Values.nameOverride | trunc 63 | trimSuffix "-" }} namespace: {{ $.Release.Namespace }} + labels: {{ include $labelsFunction $ | nindent 4 }} {{- if $.Values.global.commonLabels }} - labels: {{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonLabels "context" $ ) | nindent 4 }} + {{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonLabels "context" $ ) | nindent 4 }} {{- end }} {{- if $.Values.global.commonAnnotations }} annotations: {{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonAnnotations "context" $ ) | nindent 4 }}