turbaszek commented on a change in pull request #11815:
URL: https://github.com/apache/airflow/pull/11815#discussion_r518422998



##########
File path: airflow/utils/helpers.py
##########
@@ -202,3 +203,9 @@ def cross_downstream(*args, **kwargs):
         stacklevel=2,
     )
     return 
import_string('airflow.models.baseoperator.cross_downstream')(*args, **kwargs)
+
+
+def is_k8s_or_k8scelery_executor() -> bool:
+    """Determines if the executor utilizes k8s."""
+    conf_executor = conf.get('core', 'EXECUTOR')
+    return conf_executor in {'KubernetesExecutor', 'CeleryKubernetesExecutor'}

Review comment:
       This was not addressed. We should use 
`ExecutorLoader.KubernetesExecutor` instead of hardcoding the name. What is 
more I would be in favour of two things:
   a) move this to `executor_loader.py` module
   b) Create constant KUBERNETES_EXECUTORS = {...}
   
   Then we can do
   ```py
   def is_k8s_or_k8scelery_executor() -> bool:
      return conf.get('core', 'EXECUTOR') in KUBERNETES_EXECUTORS
   ```
   
   No strong opinion if this should be a separate function or `ExecutorsLoader` 
method.




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


Reply via email to