Skip to content

Commit 00bbfc0

Browse files
Abort run collector on ImagePullBackoff
1 parent 4149e4d commit 00bbfc0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/collect/run.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ func runWithoutTimeout(ctx context.Context, c *Collector, pod *corev1.Pod, runCo
8989
status.Status.Phase == corev1.PodSucceeded {
9090
break
9191
}
92+
if status.Status.Phase == corev1.PodPending {
93+
for k := range status.Status.ContainerStatuses {
94+
if status.Status.ContainerStatuses[k].State.Waiting.Reason == "ImagePullBackOff" {
95+
return nil, errors.Errorf("run pod aborted after getting pod status 'ImagePullBackOff'")
96+
}
97+
}
98+
}
9299
time.Sleep(time.Second * 1)
93100
}
94101

0 commit comments

Comments
 (0)