From 6bac5019aa28534fe89a0961f9a74957f23f10c8 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Wed, 27 Jan 2021 00:19:48 -0500 Subject: [PATCH] podutil: Use parenthesis for clarity around the pod ready condition While this is correct in order of operations, it is harder to read and masks the intent of the user without the parenthesis. --- pkg/api/v1/pod/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/v1/pod/util.go b/pkg/api/v1/pod/util.go index f382509aeef..9560121bbe5 100644 --- a/pkg/api/v1/pod/util.go +++ b/pkg/api/v1/pod/util.go @@ -290,7 +290,7 @@ func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool { c := GetPodReadyCondition(pod.Status) minReadySecondsDuration := time.Duration(minReadySeconds) * time.Second - if minReadySeconds == 0 || !c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(now.Time) { + if minReadySeconds == 0 || (!c.LastTransitionTime.IsZero() && c.LastTransitionTime.Add(minReadySecondsDuration).Before(now.Time)) { return true } return false