Add KubernetesPodOperator's name
in templated fields
#43480
Labels
area:providers
good first issue
kind:feature
Feature Requests
provider:cncf-kubernetes
Kubernetes provider related issues
Description
Unless it's been kept out templated fields on purpose, I would like to add the param
name
of KubernetesPodOperator into template_fields.My guess is that we wished to protect the pod name and guarantee the right syntax via
KubernetesPodOperator._set_name
. But I think we could have the best of both worlds by addingname
to template_fields and have the protected name through something likeself.pod_name = self._set_pod_name(name)
, or equivalent.Would that be worth a shot? I'm willing to submit a short PR about this.
Thanks a lot!
Use case/motivation
The current use-case is when we explore pods from the Kubernetes side, it's easy to have
pod_name=task_id
but that's not sufficient when we have several DAGs with identical tasks in them.Discriminant and dynamic information can be passed to labels or annotations since they're templated fields, but the pod name isn't.
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: