Skip to content

Commit

Permalink
fix: nil pointer error in pod health
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and adityathebe committed Aug 22, 2024
1 parent 4fd3150 commit deea254
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/health/health_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) {
continue
}

if time.Since(c.Status.State.Running.StartedAt.Time) <= time.Duration(c.Spec.ReadinessProbe.InitialDelaySeconds)*time.Second {
if c.Status.State.Running != nil && time.Since(c.Status.State.Running.StartedAt.Time) <= time.Duration(c.Spec.ReadinessProbe.InitialDelaySeconds)*time.Second {
containersWaitingForReadinessProbe = append(containersWaitingForReadinessProbe, c.Spec.Name)
}
}
Expand Down

0 comments on commit deea254

Please sign in to comment.