potiuk commented on a change in pull request #7292: [AIRFLOW-6678] Pull event
logs from Kubernetes pod on failure
URL: https://github.com/apache/airflow/pull/7292#discussion_r374167679
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -277,11 +281,19 @@ def execute(self, context):
pod,
startup_timeout=self.startup_timeout_seconds,
get_logs=self.get_logs)
+ except AirflowException:
+ if self.log_events_on_failure:
+ for event in launcher.read_pod_events(pod).items:
+ self.log.error("Pod Event: %s - %s", event.reason,
event.message)
+ raise
finally:
if self.is_delete_operator_pod:
launcher.delete_pod(pod)
if final_state != State.SUCCESS:
+ if self.log_events_on_failure:
Review comment:
You are right. No worries. I am after my 3rd coffee and still missed the
`raise`
----------------------------------------------------------------
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]
With regards,
Apache Git Services