Skip to content

Commit

Permalink
Ignore Jobs/Pods in completed or failed state during pod eviction for…
Browse files Browse the repository at this point in the history
… driver upgrade.
  • Loading branch information
shivamerla authored and cdesiniotis committed Jan 18, 2023
1 parent 686e584 commit 796c5fd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ func gpuPodSpecFilter(pod corev1.Pod) bool {
return false
}

// ignore pods other than in running and pending state
if pod.Status.Phase != corev1.PodRunning && pod.Status.Phase != corev1.PodPending {
return false
}

for _, c := range pod.Spec.Containers {
if gpuInResourceList(c.Resources.Limits) || gpuInResourceList(c.Resources.Requests) {
return true
Expand Down

0 comments on commit 796c5fd

Please sign in to comment.