hussein-awala commented on code in PR #45571:
URL: https://github.com/apache/airflow/pull/45571#discussion_r1920039545


##########
providers/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -757,6 +759,16 @@ async def _load_config(self):
             await async_config.load_kube_config_from_dict(self.config_dict)
             return async_client.ApiClient()
 
+        if kubeconfig_path is not None:
+            self.log.debug("loading kube_config from: %s", kubeconfig_path)
+            self._is_in_cluster = False
+            await async_config.load_kube_config(
+                config_file=kubeconfig_path,
+                client_configuration=self.client_configuration,
+                context=cluster_context,
+            )
+            return async_client.ApiClient()
+

Review Comment:
   This could be merged with the block below, like if kubeconfig_path is 
provided then load the file, if not, and kubeconfig is provided, write it to 
temp file and use it as  kubeconfig_path. (you may need to move the logic to an 
inner method to call it inside the temp file context and outside it)



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