This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new cc217f18eea Add JSON serialization for kubeconfig in 
AsyncKubernetesHook (#57169)
cc217f18eea is described below

commit cc217f18eea64cbe1747b9bffd5c3cd8150b8a53
Author: manipatnam <[email protected]>
AuthorDate: Sat Nov 15 20:22:05 2025 +0530

    Add JSON serialization for kubeconfig in AsyncKubernetesHook (#57169)
    
    * Add JSON serialization for kubeconfig in AsyncKubernetesHook
    
    * Add debug logging for kubeconfig serialization in AsyncKubernetesHook
    
    * Ran perk
    
    ---------
    
    Co-authored-by: Kalyan R <[email protected]>
---
 .../src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py      | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py
 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py
index 49168cc6dfc..c02488bee8b 100644
--- 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py
+++ 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py
@@ -831,6 +831,13 @@ class AsyncKubernetesHook(KubernetesHook):
                     "Reading kubernetes configuration file from connection "
                     "object and writing temporary config file with its 
content",
                 )
+                if isinstance(kubeconfig, dict):
+                    self.log.debug(
+                        LOADING_KUBE_CONFIG_FILE_RESOURCE.format(
+                            "connection kube_config dictionary (serializing)"
+                        )
+                    )
+                    kubeconfig = json.dumps(kubeconfig)
                 await temp_config.write(kubeconfig.encode())
                 await temp_config.flush()
                 self._is_in_cluster = False

Reply via email to