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 <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2022-11-25 15:17:37 +00:00
parent 0cbbf43890
commit c63ce29759

View file

@ -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 }}