Fix Kubernetes worker service account values#66598
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
jscheffl
left a comment
There was a problem hiding this comment.
Looks good. Some second pair of eyes for review @Miretpl or @jedcunningham ?
|
Static checks requires fix tho, or revert as it failes on unrelated changes |
c0f035b to
1e8107e
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Backport successfully created: chart/v1-2x-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
Fixes #66579.
When
workers.kubernetes.serviceAccount.createis explicitly set tofalse, the pod template should still use the Kubernetes worker service account name fromworkers.kubernetes.serviceAccount.nameinstead of falling back to the deprecatedworkers.serviceAccountvalues. For a pureKubernetesExecutordeployment, the legacy worker ServiceAccount should also not be rendered in that explicit Kubernetes service account path.This keeps the existing default fallback when the Kubernetes worker service account section is not explicitly configured.
Tests:
PYTHONPATH=chart/tests python -m pytest chart/tests/helm_tests/airflow_aux/test_pod_template_file.py::TestPodTemplateFile::test_dedicated_service_account_name_when_creation_disabled chart/tests/helm_tests/airflow_core/test_worker.py::TestWorkerKubernetesServiceAccount::test_should_not_create_legacy_service_account_when_k8s_service_account_disabled -qPYTHONPATH=chart/tests python -m pytest chart/tests/helm_tests/airflow_aux/test_pod_template_file.py::TestPodTemplateFile::test_service_account_name_default chart/tests/helm_tests/airflow_aux/test_pod_template_file.py::TestPodTemplateFile::test_dedicated_service_account_name_default chart/tests/helm_tests/airflow_core/test_worker.py::TestWorkerKubernetesServiceAccount::test_should_create_service_account_when_enabled -qpython -m black --check --target-version py312 chart/tests/helm_tests/airflow_aux/test_pod_template_file.py chart/tests/helm_tests/airflow_core/test_worker.pypython -m ruff check chart/tests/helm_tests/airflow_aux/test_pod_template_file.py chart/tests/helm_tests/airflow_core/test_worker.pygit diff --check