Skip to content

Commit 2ae1b9b

Browse files
abort run collector on ImagePullBackOff
1 parent 00bbfc0 commit 2ae1b9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/collect/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ func runWithoutTimeout(ctx context.Context, c *Collector, pod *corev1.Pod, runCo
9090
break
9191
}
9292
if status.Status.Phase == corev1.PodPending {
93-
for k := range status.Status.ContainerStatuses {
94-
if status.Status.ContainerStatuses[k].State.Waiting.Reason == "ImagePullBackOff" {
93+
for _, v := range status.Status.ContainerStatuses {
94+
if v.State.Waiting.Reason == "ImagePullBackOff" {
9595
return nil, errors.Errorf("run pod aborted after getting pod status 'ImagePullBackOff'")
9696
}
9797
}

0 commit comments

Comments
 (0)