juhai commented on code in PR #32278:
URL: https://github.com/apache/airflow/pull/32278#discussion_r1265015291
##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -158,6 +158,8 @@ class KubernetesPodOperator(BaseOperator):
suffix if random_name_suffix is True) to generate a pod id (DNS-1123
subdomain,
containing only [a-z0-9.-]).
:param random_name_suffix: if True, will generate a random suffix.
+ :param job_id_as_suffix: if True, will add ti.job_id to the pod name.
random_name_suffix, if set to True
+ takes precedence over this parameter.
Review Comment:
Thank you both for the feedback and the suggestions. I think the
pod_mutation_field could work but need to make sure the pod name stays within
the length limit. The `templated_field` option sounds fine too but requires a
change in the op to skip the name validity checking in the constructor. Do you
think this is worth pursuing, I could prepare a PR for that?
I found `pre_execute` to be most suitable for my purposes after all. Since
the context of the job to be launched is available I can override the name
before `execute` is called. I will close the PR for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]