Added conditions[i].Status == corev1.ConditionTrue check

Signed-off-by: Anatolii Dutchak <adutchak-x@tunein.com>
This commit is contained in:
Anatolii Dutchak 2021-04-21 18:25:42 +03:00
parent 5aa2272e37
commit 721c6553d8

View File

@ -180,7 +180,7 @@ func GetPodReadyAge(pod corev1.Pod) (bool, time.Duration) {
return false, podReadyAge
}
for i := range conditions {
if conditions[i].Type == corev1.PodReady {
if conditions[i].Type == corev1.PodReady && conditions[i].Status == corev1.ConditionTrue {
podReadyAge = time.Since(conditions[i].LastTransitionTime.Time)
return true, podReadyAge
}