Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't panic when pod is in a waiting state #276

Merged
merged 1 commit into from
Oct 6, 2020
Merged

Conversation

divolgin
Copy link
Member

@divolgin divolgin commented Oct 6, 2020

No description provided.

@divolgin divolgin merged commit 09dc6b5 into master Oct 6, 2020
Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issues found.

@@ -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" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using continue here is less conditionally indented and more readable.

View Rule

@divolgin divolgin deleted the divolgin/panic branch October 6, 2020 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants