Migrate to k8s.io/utils/clock in pkg/kubelet

This commit is contained in:
wojtekt
2021-09-09 17:07:44 +02:00
parent 392292ba81
commit 53ce79a18a
34 changed files with 88 additions and 83 deletions

View File

@@ -25,7 +25,7 @@ import (
"sync"
"time"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/utils/clock"
)
var (

View File

@@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/util/clock"
testingclock "k8s.io/utils/clock/testing"
)
func TestInsert(t *testing.T) {
@@ -200,9 +200,9 @@ func TestGC(t *testing.T) {
assertCacheSize(t, c, 1)
}
func newTestCache() (*requestCache, *clock.FakeClock) {
func newTestCache() (*requestCache, *testingclock.FakeClock) {
c := newRequestCache()
fakeClock := clock.NewFakeClock(time.Now())
fakeClock := testingclock.NewFakeClock(time.Now())
c.clock = fakeClock
return c, fakeClock
}