Skip to content

Commit

Permalink
migrate k8s.io/apimachinery/util/clock -> k8s.io/utils/clock
Browse files Browse the repository at this point in the history
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: fed2ec99c652550ed4a8c00b7cfc6c93abbc4ade
  • Loading branch information
MadhavJivrajani authored and k8s-publishing-bot committed Sep 21, 2021
1 parent 79916c5 commit 721036c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tools/record/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/clock"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/watch"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/record/util"
ref "k8s.io/client-go/tools/reference"
"k8s.io/klog/v2"
"k8s.io/utils/clock"
)

const maxTriesPerEvent = 12
Expand Down
10 changes: 5 additions & 5 deletions tools/record/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8sruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/client-go/kubernetes/scheme"
restclient "k8s.io/client-go/rest"
ref "k8s.io/client-go/tools/reference"
"k8s.io/utils/clock"
testclocks "k8s.io/utils/clock/testing"
)

Expand Down Expand Up @@ -110,7 +110,7 @@ func TestNonRacyShutdown(t *testing.T) {
// in a goroutine.

caster := NewBroadcasterForTests(0)
clock := clock.NewFakeClock(time.Now())
clock := testclocks.NewFakeClock(time.Now())
recorder := recorderWithFakeClock(v1.EventSource{Component: "eventTest"}, caster, clock)

var wg sync.WaitGroup
Expand Down Expand Up @@ -374,7 +374,7 @@ func TestEventf(t *testing.T) {
eventBroadcaster := NewBroadcasterForTests(0)
sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents)

clock := clock.NewFakeClock(time.Now())
clock := testclocks.NewFakeClock(time.Now())
recorder := recorderWithFakeClock(v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock)
for index, item := range table {
clock.Step(1 * time.Second)
Expand Down Expand Up @@ -619,7 +619,7 @@ func TestEventfNoNamespace(t *testing.T) {
eventBroadcaster := NewBroadcasterForTests(0)
sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents)

clock := clock.NewFakeClock(time.Now())
clock := testclocks.NewFakeClock(time.Now())
recorder := recorderWithFakeClock(v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock)

for index, item := range table {
Expand Down Expand Up @@ -907,7 +907,7 @@ func TestMultiSinkCache(t *testing.T) {
}

eventBroadcaster := NewBroadcasterForTests(0)
clock := clock.NewFakeClock(time.Now())
clock := testclocks.NewFakeClock(time.Now())
recorder := recorderWithFakeClock(v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock)

sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents)
Expand Down
2 changes: 1 addition & 1 deletion tools/record/events_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import (

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/client-go/util/flowcontrol"
"k8s.io/utils/clock"
)

const (
Expand Down

0 comments on commit 721036c

Please sign in to comment.