From 53a27209cf636ded4b540cc16e922417c2ef7c79 Mon Sep 17 00:00:00 2001 From: Youqing Han Date: Wed, 8 May 2024 11:41:10 +0800 Subject: [PATCH] Convert the replicas value to int for comparision --- charts/descheduler/templates/NOTES.txt | 2 +- charts/descheduler/templates/deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/descheduler/templates/NOTES.txt b/charts/descheduler/templates/NOTES.txt index 1ea9cb525..588298048 100644 --- a/charts/descheduler/templates/NOTES.txt +++ b/charts/descheduler/templates/NOTES.txt @@ -1,7 +1,7 @@ Descheduler installed as a {{ .Values.kind }}. {{- if eq .Values.kind "Deployment" }} -{{- if eq .Values.replicas 1 }} +{{- if eq (.Values.replicas | int) 1 }} WARNING: You set replica count as 1 and workload kind as Deployment however leaderElection is not enabled. Consider enabling Leader Election for HA mode. {{- end}} {{- if .Values.leaderElection }} diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index 67b0d29de..85688eec6 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: labels: {{- include "descheduler.labels" . | nindent 4 }} spec: - {{- if gt .Values.replicas 1 }} + {{- if gt (.Values.replicas | int) 1 }} {{- if not .Values.leaderElection.enabled }} {{- fail "You must set leaderElection to use more than 1 replica"}} {{- end}}