Migrate to k8s.io/utils/clock

This commit is contained in:
wojtekt
2021-09-17 11:48:22 +02:00
parent bb7dac443a
commit d9b08c611d
11 changed files with 40 additions and 38 deletions

View File

@@ -25,8 +25,8 @@ import (
"time"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/sets"
testingclock "k8s.io/utils/clock/testing"
"github.com/davecgh/go-spew/spew"
)
@@ -379,7 +379,7 @@ func testHandler(hcs *server, nsn types.NamespacedName, status int, endpoints in
func TestHealthzServer(t *testing.T) {
listener := newFakeListener()
httpFactory := newFakeHTTPServerFactory()
fakeClock := clock.NewFakeClock(time.Now())
fakeClock := testingclock.NewFakeClock(time.Now())
hs := newProxierHealthServer(listener, httpFactory, fakeClock, "127.0.0.1:10256", 10*time.Second, nil, nil)
server := hs.httpFactory.New(hs.addr, healthzHandler{hs: hs})

View File

@@ -23,10 +23,10 @@ import (
"time"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/client-go/tools/events"
"k8s.io/klog/v2"
api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/utils/clock"
)
// ProxierHealthUpdater allows callers to update healthz timestamp only.