Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

fix(helm): skip Redis/DB auto-wiring when extraEnv override is set (#1868)

Josh675a7164edd9
diff --git a/charts/sure/templates/_env.tpl b/charts/sure/templates/_env.tpl
index e50ab7ce85..e0aba60d51 100644
--- a/charts/sure/templates/_env.tpl
+++ b/charts/sure/templates/_env.tpl
@@ -48,8 +48,10 @@ The helper always injects:
key: ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT
{{- end }}
{{- if $includeDatabase }}
+{{- $railsExtraEnv := (default (dict) $ctx.Values.rails.extraEnv) -}}
+{{- $explicitDb := hasKey $railsExtraEnv "DATABASE_URL" -}}
{{- $dburl := include "sure.databaseUrl" $ctx -}}
-{{- if $dburl }}
+{{- if and $dburl (not $explicitDb) }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
@@ -60,8 +62,10 @@ The helper always injects:
{{- end }}
{{- end }}
{{- if $includeRedis }}
+{{- $railsExtraEnv := (default (dict) $ctx.Values.rails.extraEnv) -}}
+{{- $explicitRedis := hasKey $railsExtraEnv "REDIS_URL" -}}
{{- $redis := include "sure.redisUrl" $ctx -}}
-{{- if $redis }}
+{{- if and $redis (not $explicitRedis) }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef: