Skip to content

Commit

Permalink
fix(k8s): filter out failed and evicted pods when listing
Browse files Browse the repository at this point in the history
This issue caused errors when e.g. exec-ing commands and retrieving logs
from pods.

Fixes #1184
  • Loading branch information
edvald committed Sep 28, 2019
1 parent 460196a commit 65e4d0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion garden-service/src/plugins/kubernetes/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,12 @@ export async function getPods(
pod.apiVersion = "v1"
pod.kind = "Pod"
return pod
})
}).filter(pod =>
// Filter out failed pods
!(pod.status && pod.status.phase === "Failed") &&
// Filter out evicted pods
!(pod.status && pod.status.reason && pod.status.reason.includes("Evicted")),
)
}

/**
Expand Down

0 comments on commit 65e4d0f

Please sign in to comment.