Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chart/newsfragments/64982.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``workers.annotations`` field is now deprecated in favor of ``workers.celery.annotations``. Please update your configuration accordingly.
8 changes: 8 additions & 0 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
29 changes: 23 additions & 6 deletions helm-tests/tests/helm_tests/airflow_core/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,17 +1472,34 @@ def test_persistence_volume_annotations(self, workers_values):
)
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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3093,6 +3093,13 @@ def test_overwrite_host_aliases(self, workers_values):
"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):
Expand Down