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 2022/12/19 02:55:09 UTC

[GitHub] [airflow] XD-DENG commented on a diff in pull request #28436: Log FileTaskHandler to work with multi_namespace_mode when running using KubernetesExecutor

XD-DENG commented on code in PR #28436:
URL: https://github.com/apache/airflow/pull/28436#discussion_r1051751431


##########
airflow/utils/log/file_task_handler.py:
##########
@@ -191,16 +191,20 @@ def _read(self, ti: TaskInstance, try_number: int, metadata: dict[str, Any] | No
                 log += f"*** {str(e)}\n"
                 return log, {"end_of_log": True}
         elif self._should_check_k8s(ti.queue):
+            pod_override = ti.executor_config.get("pod_override")
+            if pod_override and pod_override.metadata and pod_override.metadata.namespace:
+                namespace = pod_override.metadata.namespace
+            else:
+                namespace = conf.get("kubernetes_executor", "namespace")

Review Comment:
   Currently the user is specifying the namespace (if not default namespace in the config) in the executor config. When creating the TI, also storing the actual namespace bing used in the TI record sounds sensible to me.
   
   Only concern is that this is only applicable when `KubernetesExecutor` is being used. Making it too "explicit" may confuse users who always only use other executors.
   
   



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org