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.
This commit is contained in:
Clayton Coleman 2021-01-27 00:19:48 -05:00
parent 8e6f58b0bd
commit 6bac5019aa
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3

View File

@ -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