Merge pull request #83075 from yutedz/pod-ready-time

Remove unnecessary traversal of pod.Status.Conditions
This commit is contained in:
Kubernetes Prow Robot 2019-09-25 13:52:03 -07:00 committed by GitHub
commit ea9a559093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,14 +170,12 @@ func afterOrZero(t1, t2 *metav1.Time) bool {
}
func podReadyTime(pod *corev1.Pod) *metav1.Time {
if IsPodReady(pod) {
for _, c := range pod.Status.Conditions {
// we only care about pod ready conditions
if c.Type == corev1.PodReady && c.Status == corev1.ConditionTrue {
return &c.LastTransitionTime
}
}
}
return &metav1.Time{}
}