use build-in max and min func to instead of k8s.io/utils/integer funcs

Kubernetes-commit: eb8f3f194fed16484162aebdaab69168e02f8cb4
This commit is contained in:
weilaaa
2023-12-15 15:09:11 +08:00
committed by Kubernetes Publisher
parent 12b0e099db
commit c609c97b33

View File

@@ -23,7 +23,6 @@ import (
"k8s.io/utils/clock"
testingclock "k8s.io/utils/clock/testing"
"k8s.io/utils/integer"
)
type backoffEntry struct {
@@ -100,7 +99,7 @@ func (p *Backoff) Next(id string, eventTime time.Time) {
} else {
delay := entry.backoff * 2 // exponential
delay += p.jitter(entry.backoff) // add some jitter to the delay
entry.backoff = time.Duration(integer.Int64Min(int64(delay), int64(p.maxDuration)))
entry.backoff = min(delay, p.maxDuration)
}
entry.lastUpdate = p.Clock.Now()
}