davlum commented on a change in pull request #6230: [AIRFLOW-5413] Allow K8S 
worker pod to be configured from JSON/YAML file
URL: https://github.com/apache/airflow/pull/6230#discussion_r365541701
 
 

 ##########
 File path: airflow/contrib/operators/kubernetes_pod_operator.py
 ##########
 @@ -169,8 +171,9 @@ def __init__(self,  # pylint: 
disable=too-many-arguments,too-many-locals
                  dnspolicy: Optional[str] = None,
                  schedulername: Optional[str] = None,
                  full_pod_spec: Optional[k8s.V1Pod] = None,
-                 init_containers: Optional[List[k8s.V1Container]] = None,
                  do_xcom_push: bool = False,
+                 init_containers: Optional[List[k8s.V1Container]] = None,
+                 pod_template_file=None,
 
 Review comment:
   I like this idea. Wouldn't take too much of a change either. I previously 
had support for passing both strings and paths to `pod_template_file` (simple 
`os.path.exists`), [but it was 
discussed](https://github.com/apache/airflow/pull/6230#discussion_r355993872) 
that it might be easier to just accept paths in the `PodGenerator`. 
   
   In the case of the `KubernetesPodOperator` using the `template_ext` would 
motivate passing a string to the `PodGenerator`, but in the case of configuring 
the pod from the `airflow.cfg`, paths seems to be better. 
   
   Is the `executor_config` argument templated as well? I do see a use case for 
supporting both strings and paths, and this is not a totally unheard of 
pattern. `pandas.read_csv` supports strings or paths for example.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to