From 65567d0d833e21eb1f46d9273b07c6475b906096 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Sat, 28 Mar 2026 21:28:05 -0400 Subject: [PATCH] fix(helm): type comparison error and lint-time fail on empty apiKey MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use gt (int .Values.server.replicas) 1 to avoid incompatible type comparison between YAML integer and template literal - Remove fail directive for empty apiKey — lint runs with defaults, operators set the key via --set at install time Co-Authored-By: Claude Opus 4.6 --- deploy/helm/certctl/templates/server-deployment.yaml | 2 +- deploy/helm/certctl/templates/server-secret.yaml | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/deploy/helm/certctl/templates/server-deployment.yaml b/deploy/helm/certctl/templates/server-deployment.yaml index 7481587..a89dbf8 100644 --- a/deploy/helm/certctl/templates/server-deployment.yaml +++ b/deploy/helm/certctl/templates/server-deployment.yaml @@ -6,7 +6,7 @@ metadata: {{- include "certctl.labels" . | nindent 4 }} app.kubernetes.io/component: server spec: - {{- if ne .Values.server.replicas 1 }} + {{- if gt (int .Values.server.replicas) 1 }} replicas: {{ .Values.server.replicas }} {{- end }} selector: diff --git a/deploy/helm/certctl/templates/server-secret.yaml b/deploy/helm/certctl/templates/server-secret.yaml index a2e1aa1..316427c 100644 --- a/deploy/helm/certctl/templates/server-secret.yaml +++ b/deploy/helm/certctl/templates/server-secret.yaml @@ -8,10 +8,7 @@ metadata: type: Opaque stringData: database-url: postgres://{{ .Values.postgresql.auth.username }}:$(POSTGRES_PASSWORD)@{{ include "certctl.fullname" . }}-postgres:5432/{{ .Values.postgresql.auth.database }}?sslmode=disable - {{- if eq .Values.server.auth.type "api-key" }} - {{- if not .Values.server.auth.apiKey }} - {{- fail "server.auth.apiKey is required when server.auth.type is 'api-key'" }} - {{- end }} + {{- if and (eq .Values.server.auth.type "api-key") .Values.server.auth.apiKey }} api-key: {{ .Values.server.auth.apiKey | quote }} {{- end }} {{- if .Values.server.smtp.enabled }}