Skip to content

Commit

Permalink
better error handling for evicted pods (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
oavdeev authored Sep 22, 2021
1 parent f8a4c4e commit c784b16
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion metaflow/plugins/aws/eks/kubernetes_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,19 @@ def _done():
# If pod status is dirty, check for newer status
self._pod = self._fetch_pod()
if self._pod:
pod_status = self._pod["status"]
if pod_status.get("container_statuses") is None:
# We're done, but no container_statuses is set
# This can happen when the pod is evicted
return None, ": ".join(
filter(
None,
[pod_status.get("reason"), pod_status.get("message")],
)
)

for k, v in (
self._pod["status"]
pod_status
.get("container_statuses", [{}])[0]
.get("state", {})
.items()
Expand Down

0 comments on commit c784b16

Please sign in to comment.