Sinsin1367 commented on a change in pull request #8734:
URL: https://github.com/apache/airflow/pull/8734#discussion_r422179683



##########
File path: airflow/kubernetes/pod_launcher.py
##########
@@ -183,6 +183,23 @@ def read_pod_logs(self, pod: V1Pod, tail_lines: int = 10):
                 'There was an error reading the kubernetes API: {}'.format(e)
             )
 
+    @tenacity.retry(
+        stop=tenacity.stop_after_attempt(3),
+        wait=tenacity.wait_exponential(),
+        reraise=True
+    )
+    def read_pod_status(self, pod):
+        """Reads statuses from the POD"""
+        try:
+            return self._client.read_namespaced_pod_status(
+                namespace=pod.metadata.namespace,
+                name=pod.metadata.name
+            )
+        except BaseHTTPError as e:
+            raise AirflowException(

Review comment:
       @ashb It is the way all api calls are written in pod_launcher. All other 
api calls in methods "read_pod", "read_pod_logs", and "read_pod_events" are 
capturing and throwing AirflowExection. kubernetes_pod.py is also only 
capturing AirflowException so we have to capture and rethrow with current code 
structure I would say.




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