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 3564d44ee3d Add workers.celery.annotations field (#64982)
3564d44ee3d is described below
commit 3564d44ee3d409475e98bf7409bdfd42d0b95933
Author: Przemysław Mirowski <[email protected]>
AuthorDate: Sat Apr 11 18:10:13 2026 +0200
Add workers.celery.annotations field (#64982)
* Add workers.celery.annotations
* Add newsfragment
---
chart/newsfragments/64982.significant.rst | 1 +
chart/templates/NOTES.txt | 8 ++++++
chart/values.schema.json | 10 +++++++-
chart/values.yaml | 4 +++
.../tests/helm_tests/airflow_core/test_worker.py | 29 +++++++++++++++++-----
.../helm_tests/airflow_core/test_worker_sets.py | 7 ++++++
6 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/chart/newsfragments/64982.significant.rst
b/chart/newsfragments/64982.significant.rst
new file mode 100644
index 00000000000..d8506321751
--- /dev/null
+++ b/chart/newsfragments/64982.significant.rst
@@ -0,0 +1 @@
+``workers.annotations`` field is now deprecated in favor of
``workers.celery.annotations``. Please update your configuration accordingly.
diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt
index 5273e167bad..ae4c13bc8e7 100644
--- a/chart/templates/NOTES.txt
+++ b/chart/templates/NOTES.txt
@@ -781,6 +781,14 @@ DEPRECATION WARNING:
{{- end }}
+{{- if not (empty .Values.workers.annotations) }}
+
+ DEPRECATION WARNING:
+ `workers.annotations` has been renamed to `workers.celery.annotations`.
+ Please change your values as support for the old name will be dropped in a
future release.
+
+{{- end }}
+
{{- if not (empty .Values.workers.volumeClaimTemplates) }}
DEPRECATION WARNING:
diff --git a/chart/values.schema.json b/chart/values.schema.json
index 404a90e2649..6b2a25511af 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -2403,7 +2403,7 @@
]
},
"annotations": {
- "description": "Annotations to add to the Airflow Celery
worker deployment.",
+ "description": "Annotations to add to the Airflow Celery
worker deployment (deprecated, use ``workers.celery.annotations`` instead).",
"type": "object",
"default": {},
"additionalProperties": {
@@ -3482,6 +3482,14 @@
}
]
},
+ "annotations": {
+ "description": "Annotations to add to the Airflow
Celery worker deployment.",
+ "type": "object",
+ "default": {},
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
"waitForMigrations": {
"description": "Configuration of
wait-for-airflow-migration init container for Airflow Celery workers.",
"type": "object",
diff --git a/chart/values.yaml b/chart/values.yaml
index 3096e73b2b8..1552e25e1cb 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -1127,6 +1127,7 @@ workers:
# - "test.hostname.two"
# Annotations for the Airflow Celery worker resource
+ # (deprecated, use `workers.celery.annotations` instead)
annotations: {}
# Pod annotations for the Airflow Celery workers and pods created with
pod-template-file (templated)
@@ -1513,6 +1514,9 @@ workers:
# hostnames:
# - "test.hostname.two"
+ # Annotations for the Airflow Celery worker resource
+ annotations: {}
+
# Configuration of wait-for-airflow-migration init container for Airflow
Celery workers
waitForMigrations:
# Whether to create init container to wait for db migrations
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_worker.py
b/helm-tests/tests/helm_tests/airflow_core/test_worker.py
index 6c2a5a9ab40..810e56e3967 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_worker.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_worker.py
@@ -1472,17 +1472,34 @@ class TestWorker:
)
assert
jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])
== {"foo": "bar"}
- def test_should_add_component_specific_annotations(self):
- docs = render_chart(
- values={
- "workers": {
+ @pytest.mark.parametrize(
+ "workers_values",
+ [
+ {
+ "annotations": {"test_annotation": "test_annotation_value"},
+ },
+ {
+ "celery": {
+ "annotations": {"test_annotation":
"test_annotation_value"},
+ }
+ },
+ {
+ "annotations": {"test": "test"},
+ "celery": {
"annotations": {"test_annotation":
"test_annotation_value"},
},
},
+ ],
+ )
+ def test_should_add_component_specific_annotations(self, workers_values):
+ docs = render_chart(
+ values={"workers": workers_values},
show_only=["templates/workers/worker-deployment.yaml"],
)
- assert "annotations" in jmespath.search("metadata", docs[0])
- assert jmespath.search("metadata.annotations",
docs[0])["test_annotation"] == "test_annotation_value"
+
+ assert jmespath.search("metadata.annotations", docs[0]) == {
+ "test_annotation": "test_annotation_value"
+ }
@pytest.mark.parametrize(
("globalScope", "localScope", "precedence"),
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
b/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
index 50efb69dff1..5a46add7f63 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
@@ -3093,6 +3093,13 @@ class TestWorkerSets:
"sets": [{"name": "set1", "annotations": {"test":
"echo"}}],
},
},
+ {
+ "celery": {
+ "enableDefault": False,
+ "annotations": {"echo": "test"},
+ "sets": [{"name": "set1", "annotations": {"test":
"echo"}}],
+ },
+ },
],
)
def test_overwrite_annotations(self, workers_values):