From 4b90e6d2d7dd998c4a4e09cb7b2a8b63fca20173 Mon Sep 17 00:00:00 2001 From: John Lahr Date: Thu, 31 Oct 2024 18:20:28 -0500 Subject: [PATCH] Redis Secret Password Key - Added `redisSecretPasswordKey` value Added a new `redisSecretPasswordKey` value that allows users to override the default `password` key used when specifying an existing `Secret` for Redis. This allows for a more seamless integration with popular third-party Redis Helm charts. --- charts/atlantis/Chart.yaml | 2 +- charts/atlantis/README.md | 1 + charts/atlantis/templates/statefulset.yaml | 2 +- charts/atlantis/values.schema.json | 6 +++++- charts/atlantis/values.yaml | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index 96a2bd71..cb5f1e1c 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v1 appVersion: v0.30.0 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis -version: 5.8.0 +version: 5.9.0 keywords: - terraform home: https://www.runatlantis.io diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 932ef379..eb44334b 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -176,6 +176,7 @@ extraManifests: | readinessProbe.timeoutSeconds | int | `5` | | | redis | object | `{}` | Configure Redis Locking DB. lockingDbType value must be redis for the config to take effect. Check values.yaml for examples. | | redisSecretName | string | `""` | When managing secrets outside the chart for the Redis secret, use this variable to reference the secret name. | +| redisSecretPasswordKey | string | `""` | Key within the existing Redis secret that contains the password value. | | replicaCount | int | `1` | Replica count for Atlantis pods. | | repoConfig | string | `""` | Use Server Side Repo Config, ref: https://www.runatlantis.io/docs/server-side-repo-config.html. Check values.yaml for examples. | | resources | object | `{}` | Resources for Atlantis. Check values.yaml for examples. | diff --git a/charts/atlantis/templates/statefulset.yaml b/charts/atlantis/templates/statefulset.yaml index 342b3b63..bef7e729 100644 --- a/charts/atlantis/templates/statefulset.yaml +++ b/charts/atlantis/templates/statefulset.yaml @@ -477,7 +477,7 @@ spec: valueFrom: secretKeyRef: name: {{ template "atlantis.redisSecretName" . }} - key: password + key: {{ .Values.redisSecretPasswordKey | quote }} {{- end }} {{- if .Values.redis.port }} - name: ATLANTIS_REDIS_PORT diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index af8ef852..57400398 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -1283,7 +1283,11 @@ }, "redisSecretName": { "type": "string", - "description": "Name of a pre-existing Kubernetes `Secret` containing a `password` key. Use this instead of `redis.password`." + "description": "Name of a pre-existing Kubernetes `Secret` containing the password for Redis. Use this instead of `redis.password`." + }, + "redisSecretPasswordKey": { + "type": "string", + "description": "Key within the existing Redis `Secret` that contains the password value." }, "lifecycle": { "type": "object", diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index b3c9b67c..fb1e3054 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -731,6 +731,9 @@ redis: {} # -- When managing secrets outside the chart for the Redis secret, use this variable to reference the secret name. redisSecretName: "" +# -- Key within the existing Redis secret that contains the password value. +redisSecretPasswordKey: "password" + # -- Set lifecycle hooks. # https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/. lifecycle: {}