Allow @task.kubernetes to derive pod name based on decorated function (or more flexibility to override the behaviour) #44779
Labels
kind:feature
Feature Requests
needs-triage
label for new issues that we didn't triage yet
provider:cncf-kubernetes
Kubernetes provider related issues
Description
I'd like for
@task.kubernetes
to derive the task_id / pod_name based on the decorated function's name. To achieve this now, I would need to pass it into the decorator args, which is a bit repetitive:We managed to do something like the above but it was more involved than expected:
Initially I tried wrapping
task.kubernetes
itself, but the source code scrubbing relies on a hardcoded decorator name, so it doesn't scrub the decorator and the pod fails withNameError: name 'default_kubernetes_task' is not defined
:It'd be nice if there were a more official way to achieve the above (or something similar). Perhaps:
@task.kubernetes
could accept an override for thedecorated_operator_class
?Use case/motivation
I'd like for
@task.kubernetes
to derive the task_id / pod_name based on the decorated function's name, but more generally it could be useful to allowtask.kubernetes
to be overridden?Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: