Remove unnecessary traversal of pod.Status.Conditions
Kubernetes-commit: 936ae632a0b6e1a83f1729aeff736baebbc4e68c
This commit is contained in:
parent
fc0c7def07
commit
b89bb29485
|
@ -170,12 +170,10 @@ 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
|
||||
}
|
||||
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{}
|
||||
|
|
Loading…
Reference in New Issue