Skip to content

Commit 545313a

Browse files
authored
Merge pull request #260 from manavellamnimble/abortImagePullBackoff
Abort run collector on ImagePullBackoff
2 parents 1ceab64 + 2ae1b9b commit 545313a

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 _, v := range status.Status.ContainerStatuses {
94+
if v.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)