uranusjr commented on code in PR #29929:
URL: https://github.com/apache/airflow/pull/29929#discussion_r1198535370
##########
airflow/executors/kubernetes_executor.py:
##########
@@ -216,15 +233,27 @@ def process_status(
resource_version: str,
event: Any,
) -> None:
+ annotations_string = annotations_to_str(annotations)
"""Process status response."""
if status == "Pending":
if event["type"] == "DELETED":
- self.log.info("Event: Failed to start pod %s", pod_name)
+ if get_logs_task_metadata():
+ self.log.info(
+ "Event: Failed to start pod %s, annotations: %s",
pod_name, annotations_string
+ )
+ else:
+ self.log.info("Event: Failed to start pod %s", pod_name)
Review Comment:
I wonder instead of doing if-else everywhere, if it’s better to simply do
something like
```python
if get_logs_task_metadata():
annotations_for_logging = annotations_to_str(annotations)
else:
annotations_for_logging = "<omitted>"
```
and always add the `annotations: %s` part.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]