From f3b1aaeca6b63819877ed9911623c34ae239f674 Mon Sep 17 00:00:00 2001 From: Janet Kuo Date: Mon, 2 May 2016 17:25:31 -0700 Subject: [PATCH] Fix incorrect comments in IsPodAvailable --- pkg/util/deployment/deployment.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/util/deployment/deployment.go b/pkg/util/deployment/deployment.go index baf5d15b764..9df49a2d8bc 100644 --- a/pkg/util/deployment/deployment.go +++ b/pkg/util/deployment/deployment.go @@ -286,11 +286,11 @@ func IsPodAvailable(pod *api.Pod, minReadySeconds int32) bool { for _, c := range pod.Status.Conditions { // we only care about pod ready conditions if c.Type == api.PodReady && c.Status == api.ConditionTrue { - // 2 cases that this ready condition is valid (passed minReadySeconds, i.e. the pod is ready): - // 1. minReadySeconds <= 0 + // 2 cases that this ready condition is valid (passed minReadySeconds, i.e. the pod is available): + // 1. minReadySeconds == 0, or // 2. LastTransitionTime (is set) + minReadySeconds (>0) < current time minReadySecondsDuration := time.Duration(minReadySeconds) * time.Second - if minReadySeconds <= 0 || !c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(time.Now()) { + if minReadySeconds == 0 || !c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(time.Now()) { return true } }