From 53c237657b3c5f3c579d44619b034b1fd2a5908f Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Tue, 18 Jun 2024 14:05:40 +0200 Subject: [PATCH 1/2] Fixed Helm error caused by Nil compare Fixes #36 --- charts/open-notificaties/templates/configmap.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/open-notificaties/templates/configmap.yaml b/charts/open-notificaties/templates/configmap.yaml index b57d9a7..05decf8 100644 --- a/charts/open-notificaties/templates/configmap.yaml +++ b/charts/open-notificaties/templates/configmap.yaml @@ -24,7 +24,8 @@ data: {{- end }} IS_HTTPS: {{ if .Values.settings.isHttps }}"True"{{ else }}"False"{{ end }} RABBITMQ_HOST: {{ .Values.settings.messageBroker.host }} - {{- if not eq .Values.settings.autoRetry.maxRetries nil }} + {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}} + {{- if not (has (quote .Values.settings.autoRetry.maxRetries) (list "" (quote ""))) }} NOTIFICATION_DELIVERY_MAX_RETRIES: {{ .Values.settings.autoRetry.maxRetries | toString | quote }} {{- end }} {{- if .Values.settings.autoRetry.backoff }} From 9e6b12862e4b4d5ba9d71030f85fa09c74549c36 Mon Sep 17 00:00:00 2001 From: Jeroen Vermeulen Date: Tue, 18 Jun 2024 14:05:40 +0200 Subject: [PATCH 2/2] Fixed Helm error caused by Nil compare Inspired on https://github.com/cert-manager/cert-manager/pull/6713 Fixes #36 --- charts/open-notificaties/templates/configmap.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/open-notificaties/templates/configmap.yaml b/charts/open-notificaties/templates/configmap.yaml index b57d9a7..05decf8 100644 --- a/charts/open-notificaties/templates/configmap.yaml +++ b/charts/open-notificaties/templates/configmap.yaml @@ -24,7 +24,8 @@ data: {{- end }} IS_HTTPS: {{ if .Values.settings.isHttps }}"True"{{ else }}"False"{{ end }} RABBITMQ_HOST: {{ .Values.settings.messageBroker.host }} - {{- if not eq .Values.settings.autoRetry.maxRetries nil }} + {{- /* The if statement below is equivalent to {{- if $value }} but will also return true for 0. */ -}} + {{- if not (has (quote .Values.settings.autoRetry.maxRetries) (list "" (quote ""))) }} NOTIFICATION_DELIVERY_MAX_RETRIES: {{ .Values.settings.autoRetry.maxRetries | toString | quote }} {{- end }} {{- if .Values.settings.autoRetry.backoff }}