Skip to content

Commit

Permalink
Merge pull request #57 from pfnet/fix-evictor-cond
Browse files Browse the repository at this point in the history
Fix condition to determine if pod can fail to pull image later
  • Loading branch information
ordovicia authored Aug 5, 2024
2 parents 34def88 + 3c728f4 commit 9fc9af6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/controller/evictor.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,13 @@ func (e *evictor) canFailImagePullLater(pod *corev1.Pod) bool {
return true
}

// A container's status is ContainerCreating => the container creation (including image pull) is in progress.
// A container's status is PodInitializing or ContainerCreating
// => the container creation (including image pull) is in progress.
for _, status := range append(pod.Status.InitContainerStatuses, pod.Status.ContainerStatuses...) {
if w := status.State.Waiting; w != nil && w.Reason == "ContainerCreating" {
return true
if w := status.State.Waiting; w != nil {
if w.Reason == "PodInitializing" || w.Reason == "ContainerCreating" {
return true
}
}
}

Expand Down

0 comments on commit 9fc9af6

Please sign in to comment.