diff --git a/core/docker_service_test.go b/core/docker_service_test.go index a5178856a..d25263678 100644 --- a/core/docker_service_test.go +++ b/core/docker_service_test.go @@ -29,9 +29,9 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/clock" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" containertest "k8s.io/kubernetes/pkg/kubelet/container/testing" + clock "k8s.io/utils/clock/testing" "github.com/Mirantis/cri-dockerd/libdocker" "github.com/Mirantis/cri-dockerd/network" diff --git a/libdocker/fake_client.go b/libdocker/fake_client.go index 7d15bc0ba..5bbf898e3 100644 --- a/libdocker/fake_client.go +++ b/libdocker/fake_client.go @@ -33,7 +33,7 @@ import ( dockerimagetypes "github.com/docker/docker/api/types/image" v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/clock" + "k8s.io/utils/clock" ) type CalledDetail struct { diff --git a/streaming/request_cache.go b/streaming/request_cache.go index 6e43b723e..7f644c07e 100644 --- a/streaming/request_cache.go +++ b/streaming/request_cache.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "k8s.io/apimachinery/pkg/util/clock" + "k8s.io/utils/clock" ) var ( diff --git a/streaming/request_cache_test.go b/streaming/request_cache_test.go index d9206c6b5..2bcd814ab 100644 --- a/streaming/request_cache_test.go +++ b/streaming/request_cache_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/util/clock" + clock "k8s.io/utils/clock/testing" ) func TestInsert(t *testing.T) { diff --git a/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go b/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go deleted file mode 100644 index ff97612df..000000000 --- a/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clock - -import ( - "time" - - clocks "k8s.io/utils/clock" - testclocks "k8s.io/utils/clock/testing" -) - -// PassiveClock allows for injecting fake or real clocks into code -// that needs to read the current time but does not support scheduling -// activity in the future. -// -// Deprecated: Use k8s.io/utils/clock.PassiveClock instead. -type PassiveClock = clocks.PassiveClock - -// Clock allows for injecting fake or real clocks into code that -// needs to do arbitrary things based on time. -// -// Deprecated: Use k8s.io/utils/clock.WithTickerAndDelayedExecution instead. -type Clock = clocks.WithTickerAndDelayedExecution - -// Deprecated: Use k8s.io/utils/clock.RealClock instead. -type RealClock = clocks.RealClock - -// FakePassiveClock implements PassiveClock, but returns an arbitrary time. -// -// Deprecated: Use k8s.io/utils/clock/testing.FakePassiveClock instead. -type FakePassiveClock = testclocks.FakePassiveClock - -// FakeClock implements Clock, but returns an arbitrary time. -// -// Deprecated: Use k8s.io/utils/clock/testing.FakeClock instead. -type FakeClock = testclocks.FakeClock - -// NewFakePassiveClock returns a new FakePassiveClock. -// -// Deprecated: Use k8s.io/utils/clock/testing.NewFakePassiveClock instead. -func NewFakePassiveClock(t time.Time) *testclocks.FakePassiveClock { - return testclocks.NewFakePassiveClock(t) -} - -// NewFakeClock returns a new FakeClock. -// -// Deprecated: Use k8s.io/utils/clock/testing.NewFakeClock instead. -func NewFakeClock(t time.Time) *testclocks.FakeClock { - return testclocks.NewFakeClock(t) -} - -// IntervalClock implements Clock, but each invocation of Now steps -// the clock forward the specified duration. -// -// WARNING: most of the Clock methods just `panic`; -// only PassiveClock is honestly implemented. -// The alternative, SimpleIntervalClock, has only the -// PassiveClock methods. -// -// Deprecated: Use k8s.io/utils/clock/testing.SimpleIntervalClock instead. -type IntervalClock = testclocks.IntervalClock - -// Timer allows for injecting fake or real timers into code that -// needs to do arbitrary things based on time. -// -// Deprecated: Use k8s.io/utils/clock.Timer instead. -type Timer = clocks.Timer - -// Ticker defines the Ticker interface. -// -// Deprecated: Use k8s.io/utils/clock.Ticker instead. -type Ticker = clocks.Ticker diff --git a/vendor/modules.txt b/vendor/modules.txt index 47017044c..4fb77b229 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -694,7 +694,6 @@ k8s.io/apimachinery/pkg/runtime/serializer/versioning k8s.io/apimachinery/pkg/selection k8s.io/apimachinery/pkg/types k8s.io/apimachinery/pkg/util/cache -k8s.io/apimachinery/pkg/util/clock k8s.io/apimachinery/pkg/util/diff k8s.io/apimachinery/pkg/util/errors k8s.io/apimachinery/pkg/util/framer