This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch remove-legacy-ui
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4b6a3606f8139d2dc618ed376821c16865486f42
Author: Jed Cunningham <[email protected]>
AuthorDate: Wed Feb 19 19:28:04 2025 -0700

    Fix chart default airflowlocalsettings
    
    This will need to be adjusted again when we have UIAlert support in AF3,
    but this will do for now :)
---
 chart/values.yaml                        | 21 +++++++++++++++++++++
 helm_tests/airflow_aux/test_configmap.py |  1 +
 2 files changed, 22 insertions(+)

diff --git a/chart/values.yaml b/chart/values.yaml
index e51ccdbaca2..1adb676241c 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -295,6 +295,27 @@ airflowPodAnnotations: {}
 # main Airflow configmap
 airflowConfigAnnotations: {}
 
+# `airflow_local_settings` file as a string (templated).
+airflowLocalSettings: |-
+  {{- if semverCompare ">=2.2.0 <3.0.0" .Values.airflowVersion }}
+  {{- if not (or .Values.webserverSecretKey 
.Values.webserverSecretKeySecretName) }}
+  from airflow.www.utils import UIAlert
+
+  DASHBOARD_UIALERTS = [
+    UIAlert(
+      'Usage of a dynamic webserver secret key detected. We recommend a static 
webserver secret key instead.'
+      ' See the <a href='
+      
'"https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#webserver-secret-key";
 '
+      'target="_blank" rel="noopener noreferrer">'
+      'Helm Chart Production Guide</a> for more details.',
+      category="warning",
+      roles=["Admin"],
+      html=True,
+    )
+  ]
+  {{- end }}
+  {{- end }}
+
 # Enable RBAC (default on most clusters these days)
 rbac:
   # Specifies whether RBAC resources should be created
diff --git a/helm_tests/airflow_aux/test_configmap.py 
b/helm_tests/airflow_aux/test_configmap.py
index 45a0a82a80e..6f26de3a9a5 100644
--- a/helm_tests/airflow_aux/test_configmap.py
+++ b/helm_tests/airflow_aux/test_configmap.py
@@ -51,6 +51,7 @@ class TestConfigmap:
     @pytest.mark.parametrize(
         "af_version, secret_key, secret_key_name, expected",
         [
+            ("3.0.0", None, None, False),
             ("2.2.0", None, None, True),
             ("2.2.0", "foo", None, False),
             ("2.2.0", None, "foo", False),

Reply via email to