mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Fix cond: Check if pod started
This commit is contained in:
parent
492f5fa82c
commit
8a5fbce96e
@ -170,7 +170,7 @@ func (p *basicPodStartupLatencyTracker) RecordStatusUpdated(pod *v1.Pod) {
|
|||||||
// ref: https://github.com/kubernetes/community/blob/master/sig-scalability/slos/pod_startup_latency.md
|
// ref: https://github.com/kubernetes/community/blob/master/sig-scalability/slos/pod_startup_latency.md
|
||||||
func hasPodStartedSLO(pod *v1.Pod) bool {
|
func hasPodStartedSLO(pod *v1.Pod) bool {
|
||||||
for _, cs := range pod.Status.ContainerStatuses {
|
for _, cs := range pod.Status.ContainerStatuses {
|
||||||
if cs.State.Running.StartedAt.IsZero() {
|
if cs.State.Running == nil || cs.State.Running.StartedAt.IsZero() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user