mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
Merge pull request #260 from manavellamnimble/abortImagePullBackoff
Abort run collector on ImagePullBackoff
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user