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



##########
File path: airflow/models/taskinstance.py
##########
@@ -1665,6 +1665,33 @@ def render_templates(self, context: Optional[Context] = 
None) -> None:
 
         self.task.render_template_fields(context)
 
+    def render_k8s_pod_yaml(self) -> Optional[str]:
+        """Render k8s pod yaml"""
+        from kubernetes.client.api_client import ApiClient
+
+        from airflow.executors.kubernetes_executor import KubeConfig, 
create_pod_id
+        from airflow.kubernetes.pod_generator import PodGenerator
+        from airflow.settings import pod_mutation_hook
+
+        kube_config = KubeConfig()
+        pod = PodGenerator.construct_pod(
+            dag_id=self.dag_id,
+            task_id=self.task_id,
+            pod_id=create_pod_id(self.dag_id, self.task_id),
+            try_number=self.try_number,
+            kube_image=kube_config.kube_image,
+            date=self.execution_date,
+            command=self.command_as_list(),
+            pod_override_object=PodGenerator.from_obj(self.executor_config),
+            scheduler_job_id="worker-config",
+            namespace=kube_config.executor_namespace,
+            
base_worker_pod=PodGenerator.deserialize_model_file(kube_config.pod_template_file),
+        )
+        pod_mutation_hook(pod)
+        api_client = ApiClient()

Review comment:
       It probably doesn't matter here as we aren't making an requests with 
this one.




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