This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 9a29738055 Fix redis broker URL with useStandardNaming (#34825)
9a29738055 is described below
commit 9a297380558420cc2f73a409e350f333530e279e
Author: Stefan Seelmann <[email protected]>
AuthorDate: Tue Oct 10 00:24:49 2023 +0200
Fix redis broker URL with useStandardNaming (#34825)
---
chart/templates/secrets/redis-secrets.yaml | 2 +-
helm_tests/airflow_aux/test_basic_helm_chart.py | 22 ++++++++++++++++++++++
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/chart/templates/secrets/redis-secrets.yaml
b/chart/templates/secrets/redis-secrets.yaml
index ec1ed48e0a..2722f3089f 100644
--- a/chart/templates/secrets/redis-secrets.yaml
+++ b/chart/templates/secrets/redis-secrets.yaml
@@ -76,7 +76,7 @@ metadata:
type: Opaque
data:
{{- if .Values.redis.enabled }}
- connection: {{ urlJoin (dict "scheme" "redis" "userinfo" (printf ":%s"
((default $random_redis_password .Values.redis.password) | urlquery)) "host"
(printf "%s-redis:6379" .Release.Name ) "path" "/0") | b64enc | quote }}
+ connection: {{ urlJoin (dict "scheme" "redis" "userinfo" (printf ":%s"
((default $random_redis_password .Values.redis.password) | urlquery)) "host"
(printf "%s-redis:6379" (include "airflow.fullname" .) ) "path" "/0") | b64enc
| quote }}
{{- else }}
connection: {{ (printf "%s" .Values.data.brokerUrl) | b64enc | quote }}
{{- end }}
diff --git a/helm_tests/airflow_aux/test_basic_helm_chart.py
b/helm_tests/airflow_aux/test_basic_helm_chart.py
index 5cdf1c7e98..6413a5361c 100644
--- a/helm_tests/airflow_aux/test_basic_helm_chart.py
+++ b/helm_tests/airflow_aux/test_basic_helm_chart.py
@@ -645,6 +645,28 @@ class TestBaseChartTest:
assert obj["preemptionPolicy"] == "PreemptLowerPriority"
+ def test_redis_broker_connection_url(self):
+ # no nameoverride, redis
+ doc = render_chart(
+ "my-release",
+ show_only=["templates/secrets/redis-secrets.yaml"],
+ values={"redis": {"enabled": True, "password": "test1234"}},
+ )[1]
+ assert "redis://:test1234@my-release-redis:6379/0" == base64.b64decode(
+ doc["data"]["connection"]
+ ).decode("utf-8")
+
+ def test_redis_broker_connection_url_use_standard_naming(self):
+ # no nameoverride, redis and useStandardNaming
+ doc = render_chart(
+ "my-release",
+ show_only=["templates/secrets/redis-secrets.yaml"],
+ values={"useStandardNaming": True, "redis": {"enabled": True,
"password": "test1234"}},
+ )[1]
+ assert "redis://:test1234@my-release-airflow-redis:6379/0" ==
base64.b64decode(
+ doc["data"]["connection"]
+ ).decode("utf-8")
+
@staticmethod
def default_trigger_obj(version):
if version == "default":