mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Remove unnecessary traversal of pod.Status.Conditions
This commit is contained in:
parent
53b3c8968e
commit
936ae632a0
@ -170,14 +170,12 @@ func afterOrZero(t1, t2 *metav1.Time) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func podReadyTime(pod *corev1.Pod) *metav1.Time {
|
func podReadyTime(pod *corev1.Pod) *metav1.Time {
|
||||||
if IsPodReady(pod) {
|
|
||||||
for _, c := range pod.Status.Conditions {
|
for _, c := range pod.Status.Conditions {
|
||||||
// we only care about pod ready conditions
|
// we only care about pod ready conditions
|
||||||
if c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue {
|
if c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue {
|
||||||
return &c.LastTransitionTime
|
return &c.LastTransitionTime
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return &metav1.Time{}
|
return &metav1.Time{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user