Merge pull request #260 from manavellamnimble/abortImagePullBackoff

Abort run collector on ImagePullBackoff
This commit is contained in:
divolgin
2020-09-17 08:54:39 -07:00
committed by GitHub

View File

@@ -89,6 +89,13 @@ func runWithoutTimeout(ctx context.Context, c *Collector, pod *corev1.Pod, runCo
status.Status.Phase == corev1.PodSucceeded {
break
}
if status.Status.Phase == corev1.PodPending {
for _, v := range status.Status.ContainerStatuses {
if v.State.Waiting.Reason == "ImagePullBackOff" {
return nil, errors.Errorf("run pod aborted after getting pod status 'ImagePullBackOff'")
}
}
}
time.Sleep(time.Second * 1)
}