fix(argo-cd): Same Secret name and key for all embedded redis options (#3238)

Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Marco Maurer (-Kilchhofer) 2025-04-04 05:32:42 +02:00 committed by GitHub
parent 697a5bd7dc
commit 24b35ff6b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 13 deletions

View file

@ -295,21 +295,23 @@ optional: true
secretKeyRef of env variable REDIS_PASSWORD
*/}}
{{- define "argo-cd.redisPasswordSecretRef" -}}
{{- if and .Values.redisSecretInit.enabled (not .Values.externalRedis.host) -}}
{{- if .Values.externalRedis.host -}}
{{- /* External Redis use case */ -}}
{{- /* Secret is required when specifying existingSecret or a password, otherwise it is optional */ -}}
name: {{ default "argocd-redis" .Values.externalRedis.existingSecret }}
key: redis-password
optional: {{ if or .Values.externalRedis.existingSecret .Values.externalRedis.password }}false{{ else }}true{{ end }}
{{- else if and .Values.redisSecretInit.enabled -}}
{{- /* Default case where Secret is generated by the Job with Helm pre-install hooks */ -}}
name: "argocd-redis" # hard-coded in Job command "argocd admin redis-initial-password"
name: "argocd-redis" # hard-coded in Job command and embedded Redis deployments (standalone and redis-ha)
key: auth
optional: false # Secret is not optional in this case !
{{- else if .Values.externalRedis.host -}}
{{- /* External Redis use case */ -}}
{{- /* Secret is required when specifying existingSecret, otherwise it is optional */ -}}
name: {{ default (include "argo-cd.redis.fullname" .) .Values.externalRedis.existingSecret }}
key: redis-password
optional: {{ if .Values.externalRedis.existingSecret }}false{{ else }}true{{ end }}
{{- else -}}
{{- /* All other use cases (e.g. disabled pre-install Job) */ -}}
name: {{ include "argo-cd.redis.fullname" . }}
key: redis-password
name: "argocd-redis"
key: auth
optional: true
{{- end -}}
{{- end -}}