From 62f238cdd016ccb0958663f27b26aa76c19c1bce Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Wed, 12 Apr 2023 16:25:45 +0200 Subject: [PATCH] chore(helm): disabling redis string if not enabled (#1153) Signed-off-by: rjshrjndrn --- .../charts/sourcemapreader/templates/deployment.yaml | 3 +-- scripts/helmcharts/openreplay/templates/_helpers.tpl | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml index 1d8041c5b..a6d334158 100644 --- a/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/sourcemapreader/templates/deployment.yaml @@ -51,8 +51,7 @@ spec: value: '{{ .Values.global.s3.region }}' - name: LICENSE_KEY value: '{{ .Values.global.enterpriseEditionLicense }}' - - name: REDIS_STRING - value: '{{ .Values.global.redis.redisHost }}:{{ .Values.global.redis.redisPort }}' + {{- include "openreplay.env.redis_string" .Values.global.redis | nindent 12 }} - name: KAFKA_SERVERS value: '{{ .Values.global.kafka.kafkaHost }}:{{ .Values.global.kafka.kafkaPort }}' - name: KAFKA_USE_SSL diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index 400ff0366..09a5be245 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -65,6 +65,7 @@ Create the name of the service account to use Create the environment configuration for REDIS_STRING */}} {{- define "openreplay.env.redis_string" -}} +{{- if .enabled }} {{- $scheme := (eq (.tls | default dict).enabled true) | ternary "rediss" "redis" -}} {{- $auth := "" -}} {{- if or .existingSecret .redisPassword -}} @@ -83,6 +84,7 @@ Create the environment configuration for REDIS_STRING - name: REDIS_STRING value: '{{ $scheme }}://{{ $auth }}{{ .redisHost }}:{{ .redisPort }}' {{- end }} +{{- end }} {{/* Create the volume mount config for redis TLS certificates