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

husseinawala pushed a commit to branch fix/deferrable_k8s_pod_op
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit bdef8215a6d86e2d4975a2bebb43834c19f5b591
Author: Hussein Awala <[email protected]>
AuthorDate: Tue Apr 18 02:00:04 2023 +0200

    restore convert_config_file_to_dict method and deprecate it
---
 airflow/providers/cncf/kubernetes/operators/pod.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/airflow/providers/cncf/kubernetes/operators/pod.py 
b/airflow/providers/cncf/kubernetes/operators/pod.py
index 3ff63e0393..2505ffbe2b 100644
--- a/airflow/providers/cncf/kubernetes/operators/pod.py
+++ b/airflow/providers/cncf/kubernetes/operators/pod.py
@@ -20,6 +20,7 @@ from __future__ import annotations
 
 import json
 import logging
+import os
 import re
 import secrets
 import string
@@ -559,6 +560,20 @@ class KubernetesPodOperator(BaseOperator):
         )
         self.invoke_defer_method()
 
+        def convert_config_file_to_dict(self):
+            """Converts passed config_file to dict format."""
+            warnings.warn(
+                "This method is deprecated and will be removed in a future 
version.",
+                DeprecationWarning,
+                stacklevel=2,
+            )
+            config_file = self.config_file if self.config_file else 
os.environ.get(KUBE_CONFIG_ENV_VAR)
+            if config_file:
+                with open(config_file) as f:
+                    self._config_dict = yaml.safe_load(f)
+            else:
+                self._config_dict = None
+
     def invoke_defer_method(self):
         """Method to easily redefine triggers which are being used in child 
classes."""
         trigger_start_time = utcnow()

Reply via email to