From c63ce29759621dce1be7a3fead58c04d6585078f Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Fri, 25 Nov 2022 15:17:37 +0000 Subject: [PATCH] chore(helm): Adding default value to redis tls dict As redis.tls is not defained in vars.yaml, helm will throw nil point exception. Signed-off-by: rjshrjndrn --- scripts/helmcharts/openreplay/templates/_helpers.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index a884509d8..400ff0366 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -65,7 +65,7 @@ Create the name of the service account to use Create the environment configuration for REDIS_STRING */}} {{- define "openreplay.env.redis_string" -}} -{{- $scheme := (eq .tls.enabled true) | ternary "rediss" "redis" -}} +{{- $scheme := (eq (.tls | default dict).enabled true) | ternary "rediss" "redis" -}} {{- $auth := "" -}} {{- if or .existingSecret .redisPassword -}} {{- $auth = printf "%s:$(REDIS_PASSWORD)@" (.redisUsername | default "") -}} @@ -88,7 +88,7 @@ Create the environment configuration for REDIS_STRING Create the volume mount config for redis TLS certificates */}} {{- define "openreplay.volume.redis_ca_certificate" -}} -{{- if and (.tls.enabled) (.tls.certificatesSecret) (.tls.certCAFilename) -}} +{{- if and ((.tls | default dict).enabled) (.tls.certificatesSecret) (.tls.certCAFilename) -}} - name: redis-ca-certificate secret: secretName: {{ .tls.certificatesSecret }} @@ -96,7 +96,7 @@ Create the volume mount config for redis TLS certificates {{- end }} {{- define "openreplay.volume.redis_ca_certificate.mount" -}} -{{- if and (.tls.enabled) (.tls.certificatesSecret) (.tls.certCAFilename) -}} +{{- if and ((.tls |default dict).enabled) (.tls.certificatesSecret) (.tls.certCAFilename) -}} - name: redis-ca-certificate mountPath: /etc/ssl/certs/redis-ca-certificate.pem subPath: {{ .tls.certCAFilename }}