You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/03 06:08:50 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #7405: [AIRFLOW-6780] Add option to use args instead of command in K8s pod spec

mik-laj commented on a change in pull request #7405: [AIRFLOW-6780] Add option to use args instead of command in K8s pod spec
URL: https://github.com/apache/airflow/pull/7405#discussion_r402755433
 
 

 ##########
 File path: airflow/kubernetes/pod_generator.py
 ##########
 @@ -397,24 +397,32 @@ def reconcile_containers(base_containers: List[k8s.V1Container],
         )
 
     @staticmethod
-    def construct_pod(
+    def construct_pod(  # pylint: disable=too-many-arguments
         dag_id: str,
         task_id: str,
         pod_id: str,
         try_number: int,
         date: str,
-        command: List[str],
+        command: Optional[List[str]],
         kube_executor_config: Optional[k8s.V1Pod],
         worker_config: k8s.V1Pod,
         namespace: str,
-        worker_uuid: str
+        worker_uuid: str,
+        use_args: Optional[bool] = False,
     ) -> k8s.V1Pod:
         """
         Construct a pod by gathering and consolidating the configuration from 3 places:
             - airflow.cfg
             - executor_config
             - dynamic arguments
         """
+
+        if use_args:
+            args = command
+            command = []
+        else:
+            args = []
 
 Review comment:
   It seems to me useful only for the Executor. What do you think about the constructor_pod method taking parameters args and command, and the main logic being in Kubernetes Executor?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services