seanghaeli commented on code in PR #73014:
URL: https://github.com/apache/airflow/pull/73014#discussion_r4051532934


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/kube_client.py:
##########
@@ -168,15 +168,25 @@ def get_kube_client(
     in_cluster: bool | None = None,
     cluster_context: str | None = None,
     config_file: str | None = None,
+    use_client_factory: bool = False,
 ) -> client.CoreV1Api:
     """
     Retrieve Kubernetes client.
 
     :param in_cluster: whether we are in cluster
     :param cluster_context: context of the cluster
     :param config_file: configuration file
+    :param use_client_factory: whether to honor the ``client_factory`` 
setting; only the
+        KubernetesExecutor passes this, so other callers are unaffected by the 
setting
     :return: kubernetes client
     """
+    # An import path rather than a callable, so that KubernetesJobWatcher can 
re-resolve it in
+    # its own process, where the spawn start method would not carry a callable 
over.
+    if use_client_factory and (
+        client_factory := conf.getimport("kubernetes_executor", 
"client_factory", fallback=None)

Review Comment:
   Good point, I implemented team-awareness



-- 
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]

Reply via email to