From c98d80627c6a1f9d9430c415918afa80f25257d5 Mon Sep 17 00:00:00 2001 From: shuting Date: Wed, 18 May 2022 12:16:13 +0800 Subject: [PATCH] fix: replica count in helm chart (#3954) (#3962) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché Co-authored-by: shuting Signed-off-by: ShutingZhao Co-authored-by: Charles-Edouard Brétéché --- charts/kyverno/Chart.yaml | 2 ++ charts/kyverno/templates/NOTES.txt | 2 +- charts/kyverno/templates/validate.yaml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/kyverno/Chart.yaml b/charts/kyverno/Chart.yaml index 2ec87f0ea0..76ccea3d92 100644 --- a/charts/kyverno/Chart.yaml +++ b/charts/kyverno/Chart.yaml @@ -30,3 +30,5 @@ annotations: description: Support for artifacthub.io/changes annotation - kind: added description: Allow defining imagePullSecrets + - kind: fixed + description: Replica count handling diff --git a/charts/kyverno/templates/NOTES.txt b/charts/kyverno/templates/NOTES.txt index aec28a6cf8..3f3ff67864 100644 --- a/charts/kyverno/templates/NOTES.txt +++ b/charts/kyverno/templates/NOTES.txt @@ -5,7 +5,7 @@ Thank you for installing {{ .Chart.Name }}! Your release is named {{ .Release.Na {{- if not .Values.replicaCount }} ⚠️ WARNING: Setting replicas count below 3 means Kyverno is not running in high availability mode. -{{- else if lt .Values.replicaCount 3 }} +{{- else if lt (int .Values.replicaCount) 3 }} ⚠️ WARNING: Setting replicas count below 3 means Kyverno is not running in high availability mode. {{- end }} diff --git a/charts/kyverno/templates/validate.yaml b/charts/kyverno/templates/validate.yaml index 9d01f729cb..45c03e73a0 100644 --- a/charts/kyverno/templates/validate.yaml +++ b/charts/kyverno/templates/validate.yaml @@ -3,7 +3,7 @@ {{- end }} {{- if .Values.replicaCount }} - {{- if eq .Values.replicaCount 2 }} + {{- if eq (int .Values.replicaCount) 2 }} {{ fail "Kyverno does not support running with 2 replicas. For a highly-available deployment, select 3 replicas or for standalone select 1 replica." }} {{- end }} {{- end }}