From 69de8d1787848375808cf39a22a96b65e9b541af Mon Sep 17 00:00:00 2001 From: Akash Shrivastava Date: Tue, 1 Oct 2024 00:39:08 +0530 Subject: [PATCH] fix issue when maxUnavailable was set (#130) Signed-off-by: Akash Shrivastava --- src/common/Chart.yaml | 2 +- src/common/templates/_pdb.tpl | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/Chart.yaml b/src/common/Chart.yaml index 744727a..0eed72f 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.60 +version: 1.3.61 # 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 68abbc9..01046de 100644 --- a/src/common/templates/_pdb.tpl +++ b/src/common/templates/_pdb.tpl @@ -20,7 +20,7 @@ metadata: annotations: {{- include "harnesscommon.tplvalues.render" ( dict "value" $.Values.global.commonAnnotations "context" $ ) | nindent 4 }} {{- end }} spec: - {{- $minAvailable := "50%" }} + {{- $minAvailable := "" }} {{- $maxUnavailable := "" }} {{- if $.Values.global.pdb.minAvailable }} @@ -38,9 +38,12 @@ spec: {{- if $minAvailable }} minAvailable: {{ $minAvailable }} - {{- end }} + {{- else }} {{- if $maxUnavailable }} maxUnavailable: {{ $maxUnavailable }} + {{- else }} + minAvailable: "50%" + {{- end }} {{- end }} {{- $selectorFunction := printf "%s.selectorLabels" (default $.Chart.Name $.Values.nameOverride) }} selector: