kaxil 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_r365486299
##########
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:
Just an idea, we don't need to implement this:
We can add `pod_template_file` to `template_fields` and add `.yaml` & `.yml`
to `template_ext`.
This will allow users to use Jinja templates in the Pod Template Yaml
and it would directly load the string to `pod_template_file` so we won't
need to use `open()` etc to read the file. And pass the string directly to
(`yaml.safe_load`)
----------------------------------------------------------------
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