This is an automated email from the ASF dual-hosted git repository.
bugraoz93 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 b81e335fcc4 [helm chart] Go Template Error: Cannot Compare Slice to
nil using eq (#64032)
b81e335fcc4 is described below
commit b81e335fcc45d7b03341e1dfa9e16550b3303d7e
Author: nhuantho <[email protected]>
AuthorDate: Wed May 20 03:15:27 2026 +0700
[helm chart] Go Template Error: Cannot Compare Slice to nil using eq
(#64032)
* [helm chart] Go Template Error: Cannot Compare Slice to nil using eq
* Fix statics check
* Apply copilot suggestion
---
chart/templates/_helpers.yaml | 2 +-
chart/tests/helm_tests/airflow_core/test_worker_sets.py | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/chart/templates/_helpers.yaml b/chart/templates/_helpers.yaml
index d2aa1e093e4..3445f256a0f 100644
--- a/chart/templates/_helpers.yaml
+++ b/chart/templates/_helpers.yaml
@@ -1145,7 +1145,7 @@ Usage:
{{- if gt (len $nested) 0 -}}
{{- $_ := set $newValues $key $nested -}}
{{- end -}}
- {{- else if not (eq $val nil) -}}
+ {{- else if not (kindIs "invalid" $val) -}}
{{- $_ := set $newValues $key $val -}}
{{- end -}}
{{- end -}}
diff --git a/chart/tests/helm_tests/airflow_core/test_worker_sets.py
b/chart/tests/helm_tests/airflow_core/test_worker_sets.py
index 3a3c035ec8d..ce38d98b2b7 100644
--- a/chart/tests/helm_tests/airflow_core/test_worker_sets.py
+++ b/chart/tests/helm_tests/airflow_core/test_worker_sets.py
@@ -37,6 +37,22 @@ class TestWorkerSets:
assert objects_number == len(docs)
+ def test_empty_worker_sets_renders_only_default_worker(self):
+ docs = render_chart(
+ name="test",
+ values={
+ "workers": {
+ "celery": {
+ "enableDefault": True,
+ "sets": [],
+ },
+ },
+ },
+ show_only=["templates/workers/worker-deployment.yaml"],
+ )
+
+ assert jmespath.search("[*].metadata.name", docs) == ["test-worker"]
+
@pytest.mark.parametrize(
("enable_default", "expected"),
[