Merge pull request #276 from replicatedhq/divolgin/panic

Don't panic when pod is in a waiting state
This commit is contained in:
divolgin
2020-10-05 17:27:04 -07:00
committed by GitHub

View File

@@ -90,7 +90,7 @@ func runWithoutTimeout(ctx context.Context, c *Collector, pod *corev1.Pod, runCo
}
if status.Status.Phase == corev1.PodPending {
for _, v := range status.Status.ContainerStatuses {
if v.State.Waiting.Reason == "ImagePullBackOff" {
if v.State.Waiting != nil && v.State.Waiting.Reason == "ImagePullBackOff" {
return nil, errors.Errorf("run pod aborted after getting pod status 'ImagePullBackOff'")
}
}