Skip to content

Commit

Permalink
check exit code also
Browse files Browse the repository at this point in the history
  • Loading branch information
ashnamehrotra committed Aug 21, 2023
1 parent 885e934 commit 332bf6f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/imagejob/imagejob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,8 @@ func podsComplete(podList []corev1.Pod) bool {

func containersFailed(pod *corev1.Pod) bool {
statuses := pod.Status.ContainerStatuses
log.Info("Statuses", "container statuses", statuses)
for i := range statuses {
if statuses[i].State.Terminated != nil {
if statuses[i].State.Terminated != nil && statuses[i].State.Terminated.ExitCode != 0 {
return true
}
}
Expand Down

0 comments on commit 332bf6f

Please sign in to comment.