Skip to content

Commit 5c283cb

Browse files
committed
flowcontrol: remove testing dependencies
The methods NewFakeClock were using a testing dependency as a parameter, to avoid breaking compatibility and to remove this dependency, just use the clock.Clock interface. If we have to do it again most probable we have chosen other pattern and for sure other names, but now is too late.
1 parent e8615e2 commit 5c283cb

File tree

1 file changed

+2
-3
lines changed
  • staging/src/k8s.io/client-go/util/flowcontrol

1 file changed

+2
-3
lines changed

staging/src/k8s.io/client-go/util/flowcontrol/backoff.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"time"
2323

2424
"k8s.io/utils/clock"
25-
testingclock "k8s.io/utils/clock/testing"
2625
)
2726

2827
type backoffEntry struct {
@@ -49,15 +48,15 @@ type Backoff struct {
4948
maxJitterFactor float64
5049
}
5150

52-
func NewFakeBackOff(initial, max time.Duration, tc *testingclock.FakeClock) *Backoff {
51+
func NewFakeBackOff(initial, max time.Duration, tc clock.Clock) *Backoff {
5352
return newBackoff(tc, initial, max, 0.0)
5453
}
5554

5655
func NewBackOff(initial, max time.Duration) *Backoff {
5756
return NewBackOffWithJitter(initial, max, 0.0)
5857
}
5958

60-
func NewFakeBackOffWithJitter(initial, max time.Duration, tc *testingclock.FakeClock, maxJitterFactor float64) *Backoff {
59+
func NewFakeBackOffWithJitter(initial, max time.Duration, tc clock.Clock, maxJitterFactor float64) *Backoff {
6160
return newBackoff(tc, initial, max, maxJitterFactor)
6261
}
6362

0 commit comments

Comments
 (0)