Skip to content

Conversation

@DjVinnii
Copy link
Contributor

Default to None for the automounting of the Service Account Token to keep the behavior as close to the Kubernetes default behavior. Also make sure that the merge_objects() function in the Pod Generator does not default to the client value (None in this case) when the base value is explicitly falsy. This was causing issues if a pod_template_file was provided where value of automountServiceAccount was set to false.

related: #50599 (comment)


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@eladkal
Copy link
Contributor

eladkal commented May 20, 2025

Static checks are failing

Run 'ruff' for extremely fast Python linting................................Failed
- hook id: ruff
- exit code: 1

All checks passed!
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_pod.py:1040:16: E712 Avoid equality comparisons to `False`; use `if not pod.spec.automount_service_account_token:` for false 

@eladkal eladkal force-pushed the KPO-automountServiceAccountToken branch from 531919f to 57a8c91 Compare May 20, 2025 06:59
@eladkal eladkal merged commit 0dbfd0c into apache:main May 20, 2025
76 checks passed
@DjVinnii DjVinnii deleted the KPO-automountServiceAccountToken branch May 21, 2025 16:50
dadonnelly316 pushed a commit to dadonnelly316/airflow that referenced this pull request May 26, 2025
…ate (apache#50800)

* Set default to None

* Update tests

* Check for None values instead Falsy values

* Fix tests

* fix static checks

---------

Co-authored-by: Vincent Kling <vincent.kling@stedin.net>
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
…ate (apache#50800)

* Set default to None

* Update tests

* Check for None values instead Falsy values

* Fix tests

* fix static checks

---------

Co-authored-by: Vincent Kling <vincent.kling@stedin.net>
Co-authored-by: Elad Kalif <45845474+eladkal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants