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

jscheffl 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 d470fe7bfb0 Change default for Service Links for Chart 2.0 (#67803)
d470fe7bfb0 is described below

commit d470fe7bfb03353925b34c71e4eb347869e6252c
Author: Jens Scheffler <[email protected]>
AuthorDate: Tue Jun 2 00:36:06 2026 +0200

    Change default for Service Links for Chart 2.0 (#67803)
    
    * Change default for Service Links for Chart 2.0
    
    * Change default for Service Links for Chart 2.0
    
    * Remove nil handling and helper
    
    * Remove none test case
---
 chart/files/pod-template-file.kubernetes-helm-yaml           |  2 +-
 chart/newsfragments/67447.significant.rst                    |  3 ---
 chart/newsfragments/67803.significant.rst                    |  3 +++
 chart/templates/NOTES.txt                                    |  8 --------
 chart/templates/_helpers.yaml                                | 12 ------------
 chart/templates/api-server/api-server-deployment.yaml        |  2 +-
 chart/templates/cleanup/cleanup-cronjob.yaml                 |  2 +-
 chart/templates/dag-processor/dag-processor-deployment.yaml  |  2 +-
 .../templates/database-cleanup/database-cleanup-cronjob.yaml |  2 +-
 chart/templates/flower/flower-deployment.yaml                |  2 +-
 chart/templates/jobs/create-user-job.yaml                    |  2 +-
 chart/templates/jobs/migrate-database-job.yaml               |  2 +-
 .../templates/otel-collector/otel-collector-deployment.yaml  |  2 +-
 chart/templates/pgbouncer/pgbouncer-deployment.yaml          |  2 +-
 chart/templates/redis/redis-statefulset.yaml                 |  2 +-
 chart/templates/scheduler/scheduler-deployment.yaml          |  2 +-
 chart/templates/statsd/statsd-deployment.yaml                |  2 +-
 chart/templates/triggerer/triggerer-deployment.yaml          |  2 +-
 chart/templates/workers/worker-deployment.yaml               |  2 +-
 chart/tests/helm_tests/airflow_aux/test_airflow_common.py    |  2 +-
 chart/values.schema.json                                     |  9 +++------
 chart/values.yaml                                            |  2 +-
 22 files changed, 23 insertions(+), 46 deletions(-)

diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml 
b/chart/files/pod-template-file.kubernetes-helm-yaml
index 61314e2a4d3..e25508bc9e9 100644
--- a/chart/files/pod-template-file.kubernetes-helm-yaml
+++ b/chart/files/pod-template-file.kubernetes-helm-yaml
@@ -229,7 +229,7 @@ spec:
   {{- else }}
   serviceAccountName: {{ include "worker.serviceAccountName" . }}
   {{- end }}
-  {{- include "serviceLinks" . | nindent 2 }}
+  enableServiceLinks: {{ .Values.enableServiceLinks }}
   volumes:
   {{- if .Values.dags.persistence.enabled }}
   - name: dags
diff --git a/chart/newsfragments/67447.significant.rst 
b/chart/newsfragments/67447.significant.rst
deleted file mode 100644
index 459f1c38c9d..00000000000
--- a/chart/newsfragments/67447.significant.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Added support for configuring ``enableServiceLinks``.
-
-Warning: The default will become ``false`` in ``Chart 2.0``. If you rely on 
these environment variables, explicitly set ``enableServiceLinks: true``, or 
migrate your code to use dns based service lookups.
diff --git a/chart/newsfragments/67803.significant.rst 
b/chart/newsfragments/67803.significant.rst
new file mode 100644
index 00000000000..d27d26c9701
--- /dev/null
+++ b/chart/newsfragments/67803.significant.rst
@@ -0,0 +1,3 @@
+Default for ``enableServiceLinks`` changed to false.
+
+Warning: The default is false in ``Chart 2.0``. If you rely on these 
environment variables, explicitly set ``enableServiceLinks: true``, or migrate 
your code to use dns based service lookups.
diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt
index bb8a5eb6faa..2ba8c2401e6 100644
--- a/chart/templates/NOTES.txt
+++ b/chart/templates/NOTES.txt
@@ -938,14 +938,6 @@ DEPRECATION WARNING:
 
 {{- end }}
 
-{{- if (eq .Values.enableServiceLinks nil) }}
-
-  DEPRECATION WARNING:
-    The default for `enableServiceLinks` will become False in Chart 2.0.
-    If you relied on these environment variables, explicitly set 
``enableServiceLinks: true``, or migrate your code to use dns based service 
lookups.
-
-{{- end }}
-
 {{- if not (or .Values.apiSecretKey .Values.apiSecretKeySecretName) }}
 #####################################################
 #  WARNING: You should set a static API secret key  #
diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml
index 4c026e23935..7f991266c17 100644
--- a/chart/templates/_helpers.yaml
+++ b/chart/templates/_helpers.yaml
@@ -1204,15 +1204,3 @@ Usage:
           path: namespace
   {{- end }}
 {{- end -}}
-
-{{/*
-Set service links if not null.
-
-Usage:
-  {{ include "serviceLinks" . }}
-*/}}
-{{- define "serviceLinks" -}}
-{{- if not (eq .Values.enableServiceLinks nil) -}}
-enableServiceLinks: {{ .Values.enableServiceLinks }}
-{{- end }}
-{{- end -}}
diff --git a/chart/templates/api-server/api-server-deployment.yaml 
b/chart/templates/api-server/api-server-deployment.yaml
index 963332a79a1..8fabd32ca03 100644
--- a/chart/templates/api-server/api-server-deployment.yaml
+++ b/chart/templates/api-server/api-server-deployment.yaml
@@ -106,7 +106,7 @@ spec:
       hostAliases: {{- toYaml .Values.apiServer.hostAliases | nindent 8 }}
       {{- end }}
       serviceAccountName: {{ include "apiServer.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       {{- if .Values.apiServer.priorityClassName }}
       priorityClassName: {{ .Values.apiServer.priorityClassName }}
       {{- end }}
diff --git a/chart/templates/cleanup/cleanup-cronjob.yaml 
b/chart/templates/cleanup/cleanup-cronjob.yaml
index fe3d6a33b48..ef243ec0000 100644
--- a/chart/templates/cleanup/cleanup-cronjob.yaml
+++ b/chart/templates/cleanup/cleanup-cronjob.yaml
@@ -86,7 +86,7 @@ spec:
           tolerations: {{- toYaml $tolerations | nindent 12 }}
           topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 12 }}
           serviceAccountName: {{ include "cleanup.serviceAccountName" . }}
-          {{- include "serviceLinks" . | nindent 10 }}
+          enableServiceLinks: {{ .Values.enableServiceLinks }}
           imagePullSecrets: {{- include "image_pull_secrets" . | nindent 12 }}
           securityContext: {{ $securityContext | nindent 12 }}
           containers:
diff --git a/chart/templates/dag-processor/dag-processor-deployment.yaml 
b/chart/templates/dag-processor/dag-processor-deployment.yaml
index c19bed8a95a..1f42c471afd 100644
--- a/chart/templates/dag-processor/dag-processor-deployment.yaml
+++ b/chart/templates/dag-processor/dag-processor-deployment.yaml
@@ -110,7 +110,7 @@ spec:
       terminationGracePeriodSeconds: {{ 
.Values.dagProcessor.terminationGracePeriodSeconds }}
       restartPolicy: Always
       serviceAccountName: {{ include "dagProcessor.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       securityContext: {{ $securityContext | nindent 8 }}
       imagePullSecrets: {{ include "image_pull_secrets" . | nindent 8 }}
       initContainers:
diff --git a/chart/templates/database-cleanup/database-cleanup-cronjob.yaml 
b/chart/templates/database-cleanup/database-cleanup-cronjob.yaml
index 140e6f3c5f7..93c0d30a7c4 100644
--- a/chart/templates/database-cleanup/database-cleanup-cronjob.yaml
+++ b/chart/templates/database-cleanup/database-cleanup-cronjob.yaml
@@ -89,7 +89,7 @@ spec:
           tolerations: {{- toYaml $tolerations | nindent 12 }}
           topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 12 }}
           serviceAccountName: {{ include "databaseCleanup.serviceAccountName" 
. }}
-          {{- include "serviceLinks" . | nindent 10 }}
+          enableServiceLinks: {{ .Values.enableServiceLinks }}
           imagePullSecrets: {{- include "image_pull_secrets" . | nindent 12 }}
           securityContext: {{ $securityContext | nindent 12 }}
           containers:
diff --git a/chart/templates/flower/flower-deployment.yaml 
b/chart/templates/flower/flower-deployment.yaml
index 0563ae05c25..3e93610faf0 100644
--- a/chart/templates/flower/flower-deployment.yaml
+++ b/chart/templates/flower/flower-deployment.yaml
@@ -79,7 +79,7 @@ spec:
       tolerations: {{- toYaml $tolerations | nindent 8 }}
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       serviceAccountName: {{ include "flower.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       {{- if .Values.flower.priorityClassName }}
       priorityClassName: {{ .Values.flower.priorityClassName }}
       {{- end }}
diff --git a/chart/templates/jobs/create-user-job.yaml 
b/chart/templates/jobs/create-user-job.yaml
index e670151708c..2d09a85d3a3 100644
--- a/chart/templates/jobs/create-user-job.yaml
+++ b/chart/templates/jobs/create-user-job.yaml
@@ -86,7 +86,7 @@ spec:
       tolerations: {{- toYaml $tolerations | nindent 8 }}
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       serviceAccountName: {{ include "createUserJob.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       imagePullSecrets: {{- include "image_pull_secrets" . | nindent 8 }}
       {{- if .Values.createUserJob.extraInitContainers }}
       initContainers:
diff --git a/chart/templates/jobs/migrate-database-job.yaml 
b/chart/templates/jobs/migrate-database-job.yaml
index b18d3c9290e..d56c6ce78a9 100644
--- a/chart/templates/jobs/migrate-database-job.yaml
+++ b/chart/templates/jobs/migrate-database-job.yaml
@@ -86,7 +86,7 @@ spec:
       tolerations: {{- toYaml $tolerations | nindent 8 }}
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       serviceAccountName: {{ include "migrateDatabaseJob.serviceAccountName" . 
}}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       imagePullSecrets: {{- include "image_pull_secrets" . | nindent 8 }}
       {{- if .Values.migrateDatabaseJob.extraInitContainers }}
       initContainers:
diff --git a/chart/templates/otel-collector/otel-collector-deployment.yaml 
b/chart/templates/otel-collector/otel-collector-deployment.yaml
index 0bea8a53109..abbcbc8bd9b 100644
--- a/chart/templates/otel-collector/otel-collector-deployment.yaml
+++ b/chart/templates/otel-collector/otel-collector-deployment.yaml
@@ -73,7 +73,7 @@ spec:
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       terminationGracePeriodSeconds: {{ 
.Values.otelCollector.terminationGracePeriodSeconds }}
       serviceAccountName: {{ include "otelCollector.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       {{- if .Values.otelCollector.priorityClassName }}
       priorityClassName: {{ .Values.otelCollector.priorityClassName }}
       {{- end }}
diff --git a/chart/templates/pgbouncer/pgbouncer-deployment.yaml 
b/chart/templates/pgbouncer/pgbouncer-deployment.yaml
index 45c4a714877..1cd49eba0dd 100644
--- a/chart/templates/pgbouncer/pgbouncer-deployment.yaml
+++ b/chart/templates/pgbouncer/pgbouncer-deployment.yaml
@@ -88,7 +88,7 @@ spec:
       tolerations: {{- toYaml $tolerations | nindent 8 }}
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       serviceAccountName: {{ include "pgbouncer.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       securityContext: {{ $securityContext | nindent 8 }}
       restartPolicy: Always
       imagePullSecrets: {{- include "image_pull_secrets" . | nindent 8 }}
diff --git a/chart/templates/redis/redis-statefulset.yaml 
b/chart/templates/redis/redis-statefulset.yaml
index e1d58416d48..361c229212a 100644
--- a/chart/templates/redis/redis-statefulset.yaml
+++ b/chart/templates/redis/redis-statefulset.yaml
@@ -83,7 +83,7 @@ spec:
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       terminationGracePeriodSeconds: {{ 
.Values.redis.terminationGracePeriodSeconds }}
       serviceAccountName: {{ include "redis.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       {{- if .Values.schedulerName }}
       schedulerName: {{ .Values.schedulerName }}
       {{- end }}
diff --git a/chart/templates/scheduler/scheduler-deployment.yaml 
b/chart/templates/scheduler/scheduler-deployment.yaml
index 8a36460c52a..66fd4260592 100644
--- a/chart/templates/scheduler/scheduler-deployment.yaml
+++ b/chart/templates/scheduler/scheduler-deployment.yaml
@@ -133,7 +133,7 @@ spec:
       restartPolicy: Always
       terminationGracePeriodSeconds: {{ 
.Values.scheduler.terminationGracePeriodSeconds }}
       serviceAccountName: {{ include "scheduler.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       {{- if and (eq (include "airflow.podLaunchingExecutor" .) "true") (not 
.Values.scheduler.serviceAccount.automountServiceAccountToken) }}
       automountServiceAccountToken: false
       {{- end }}
diff --git a/chart/templates/statsd/statsd-deployment.yaml 
b/chart/templates/statsd/statsd-deployment.yaml
index 9963ccd4858..bb47d7d0400 100644
--- a/chart/templates/statsd/statsd-deployment.yaml
+++ b/chart/templates/statsd/statsd-deployment.yaml
@@ -84,7 +84,7 @@ spec:
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       terminationGracePeriodSeconds: {{ 
.Values.statsd.terminationGracePeriodSeconds }}
       serviceAccountName: {{ include "statsd.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       securityContext: {{ $securityContext | nindent 8 }}
       restartPolicy: Always
       imagePullSecrets: {{ include "image_pull_secrets" . | nindent 8 }}
diff --git a/chart/templates/triggerer/triggerer-deployment.yaml 
b/chart/templates/triggerer/triggerer-deployment.yaml
index adccf67f2cc..2b4149b9a3b 100644
--- a/chart/templates/triggerer/triggerer-deployment.yaml
+++ b/chart/templates/triggerer/triggerer-deployment.yaml
@@ -127,7 +127,7 @@ spec:
       terminationGracePeriodSeconds: {{ 
.Values.triggerer.terminationGracePeriodSeconds }}
       restartPolicy: Always
       serviceAccountName: {{ include "triggerer.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       securityContext: {{ $securityContext | nindent 8 }}
       imagePullSecrets: {{ include "image_pull_secrets" . | nindent 8 }}
       initContainers:
diff --git a/chart/templates/workers/worker-deployment.yaml 
b/chart/templates/workers/worker-deployment.yaml
index 56caeddc981..1f3150a4063 100644
--- a/chart/templates/workers/worker-deployment.yaml
+++ b/chart/templates/workers/worker-deployment.yaml
@@ -157,7 +157,7 @@ spec:
       terminationGracePeriodSeconds: {{ 
.Values.workers.terminationGracePeriodSeconds }}
       restartPolicy: Always
       serviceAccountName: {{ include "worker.serviceAccountName" . }}
-      {{- include "serviceLinks" . | nindent 6 }}
+      enableServiceLinks: {{ .Values.enableServiceLinks }}
       securityContext: {{ $securityContext | nindent 8 }}
       imagePullSecrets: {{ include "image_pull_secrets" . | nindent 8 }}
       initContainers:
diff --git a/chart/tests/helm_tests/airflow_aux/test_airflow_common.py 
b/chart/tests/helm_tests/airflow_aux/test_airflow_common.py
index 251d8642127..e2ef6f9370b 100644
--- a/chart/tests/helm_tests/airflow_aux/test_airflow_common.py
+++ b/chart/tests/helm_tests/airflow_aux/test_airflow_common.py
@@ -527,7 +527,7 @@ class TestAirflowCommon:
 
     @pytest.mark.parametrize(
         "enable_service_links",
-        [None, True, False],
+        [True, False],
     )
     def test_service_links(
         self,
diff --git a/chart/values.schema.json b/chart/values.schema.json
index 4c0b8162d3a..bc094f6b5fb 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -227,12 +227,9 @@
             }
         },
         "enableServiceLinks": {
-            "description": "Enable Kubernetes service links. The default will 
become false in Chart 2.0.",
-            "type": [
-                "boolean",
-                "null"
-            ],
-            "default": null,
+            "description": "Enable Kubernetes service links. The default is 
false in Chart 2.0.",
+            "type": "boolean",
+            "default": false,
             "x-docsSection": "Kubernetes"
         },
         "imagePullSecrets": {
diff --git a/chart/values.yaml b/chart/values.yaml
index 0e1358fa48b..4213d755884 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -137,7 +137,7 @@ schedulerName: ~
 # Add common labels to all objects and pods defined in this chart.
 labels: {}
 # Whenever service links should be added to each pod.
-enableServiceLinks: ~
+enableServiceLinks: false
 
 # List of existing Kubernetes secrets containing Base64 encoded credentials to 
connect to private
 # registries. Items can be either strings or {name: secret} objects.

Reply via email to