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

@@ -23,8 +23,8 @@ import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/client-go/tools/record"
testingclock "k8s.io/utils/clock/testing"
)
// mockPodStatusProvider returns the status on the specified pod
@@ -45,7 +45,7 @@ func (m *mockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool)
// TestActiveDeadlineHandler verifies the active deadline handler functions as expected.
func TestActiveDeadlineHandler(t *testing.T) {
pods := newTestPods(4)
fakeClock := clock.NewFakeClock(time.Now())
fakeClock := testingclock.NewFakeClock(time.Now())
podStatusProvider := &mockPodStatusProvider{pods: pods}
fakeRecorder := &record.FakeRecorder{}
handler, err := newActiveDeadlineHandler(podStatusProvider, fakeRecorder, fakeClock)