From 721c6553d85c218135037e037a941dbebc670370 Mon Sep 17 00:00:00 2001 From: Anatolii Dutchak Date: Wed, 21 Apr 2021 18:25:42 +0300 Subject: [PATCH] Added conditions[i].Status == corev1.ConditionTrue check Signed-off-by: Anatolii Dutchak --- pkg/collector/pod_collector.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/collector/pod_collector.go b/pkg/collector/pod_collector.go index bce8938..e5cb2db 100644 --- a/pkg/collector/pod_collector.go +++ b/pkg/collector/pod_collector.go @@ -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 }