From b1ebc9cc85a3cfe737b21a079e86d98b01edd2d0 Mon Sep 17 00:00:00 2001 From: Isaiah Olson Date: Mon, 3 Nov 2025 23:59:12 -0600 Subject: [PATCH 1/2] Fixes for NATS App Helm chart, fix template issues with config.merge value Signed-off-by: Isaiah Olson --- packages/apps/nats/templates/nats.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/apps/nats/templates/nats.yaml b/packages/apps/nats/templates/nats.yaml index 55e0bd85..d44c0bcf 100644 --- a/packages/apps/nats/templates/nats.yaml +++ b/packages/apps/nats/templates/nats.yaml @@ -52,7 +52,7 @@ spec: resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 12 }} fullnameOverride: {{ .Release.Name }} config: - {{- if or (gt (len $passwords) 0) (gt (len .Values.config.merge) 0) }} + {{- if or (gt (len $passwords) 0) (and .Values.config (hasKey .Values.config "merge") (gt (len .Values.config.merge) 0)) }} merge: {{- if gt (len $passwords) 0 }} accounts: @@ -63,8 +63,8 @@ spec: password: "{{ $password }}" {{- end }} {{- end }} - {{- if and .Values.config (hasKey .Values.config "merge") }} - {{ toYaml .Values.config.merge | nindent 12 }} + {{- if and .Values.config (hasKey .Values.config "merge") (gt (len .Values.config.merge) 0) }} + {{ toYaml .Values.config.merge | nindent 10 }} {{- end }} {{- end }} {{- if and .Values.config (hasKey .Values.config "resolver") }} From 172774b6cd2e01b206a5f6fa9fe4c3a3b0df0394 Mon Sep 17 00:00:00 2001 From: Timofei Larkin Date: Tue, 4 Nov 2025 18:22:43 +0300 Subject: [PATCH 2/2] [nats] Terser checks using `with` This patch makes the fixes from `b1ebc9cc` by @insignia96 terser by making use of Helm's `with` blocks. Signed-off-by: Timofei Larkin --- packages/apps/nats/templates/nats.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/apps/nats/templates/nats.yaml b/packages/apps/nats/templates/nats.yaml index d44c0bcf..b5cfd6e4 100644 --- a/packages/apps/nats/templates/nats.yaml +++ b/packages/apps/nats/templates/nats.yaml @@ -52,9 +52,9 @@ spec: resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.resourcesPreset .Values.resources $) | nindent 12 }} fullnameOverride: {{ .Release.Name }} config: - {{- if or (gt (len $passwords) 0) (and .Values.config (hasKey .Values.config "merge") (gt (len .Values.config.merge) 0)) }} + {{- if or $passwords .Values.config.merge }} merge: - {{- if gt (len $passwords) 0 }} + {{- if $passwords }} accounts: A: users: @@ -63,13 +63,13 @@ spec: password: "{{ $password }}" {{- end }} {{- end }} - {{- if and .Values.config (hasKey .Values.config "merge") (gt (len .Values.config.merge) 0) }} - {{ toYaml .Values.config.merge | nindent 10 }} + {{- with .Values.config.merge }} + {{- toYaml . | nindent 10 }} {{- end }} {{- end }} - {{- if and .Values.config (hasKey .Values.config "resolver") }} + {{- with .Values.config.resolver }} resolver: - {{ toYaml .Values.config.resolver | nindent 12 }} + {{- toYaml . | nindent 10 }} {{- end }} cluster: enabled: true