Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More meaningful @task.kubernetes pod naming #46535

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

insomnes
Copy link
Contributor

@insomnes insomnes commented Feb 6, 2025

Use name based on decorated python callable in @task.kubernetes pod name generation

  • generate attribute and metadata pod name based on decorated python callable
  • drop uuid usage as a random suffix in favor of random_name_suffix argument
  • add specific pod naming tests for decorator flow because the decorator distinguishes between name=None and no name argument provided

Re-implementation of the previous PR messed up by new providers structure rebasing
#46462

closes: #46464


^ 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 newsfragments.

- use decorated `python_callable.__name__` as part of the name created for pod by default.
- drop `uuid` usage in favor of present `random_name_suffix` argument
@boring-cyborg boring-cyborg bot added the provider:cncf-kubernetes Kubernetes provider related issues label Feb 6, 2025
@insomnes
Copy link
Contributor Author

insomnes commented Feb 6, 2025

@RNHTTR I am sorry to bother you, but do you mind taking a look at the re-creation of the previous PR already approved by you? I've messed up a ton with rebasing for the new providers structure, so I've re-created it. Also, the CODEOWNERS file was broken at the moment, now this new PR is lost in limbo. Thank you!

The changes are the same, and now the tests are green after fixes in main.

@potiuk
Copy link
Member

potiuk commented Feb 8, 2025

Nice!

@potiuk potiuk merged commit 33c53d4 into apache:main Feb 8, 2025
72 checks passed
@RNHTTR
Copy link
Contributor

RNHTTR commented Feb 10, 2025

Nice one @insomnes !

ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
* More meaningful default name for @task.kubernetes pods

- use decorated `python_callable.__name__` as part of the name created for pod by default.
- drop `uuid` usage in favor of present `random_name_suffix` argument

* Update task.kubernetes decorator doc-string
@insomnes insomnes deleted the task-k8s-pod-naming branch February 17, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider:cncf-kubernetes Kubernetes provider related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More meaningful name for @task.kubernetes pods by default
3 participants