cleanup: import from k8s.io/utils/clock/testing instead

Signed-off-by: haoyun <yun.hao@daocloud.io>
This commit is contained in:
haoyun 2021-09-30 23:34:56 +08:00
parent 6484fab1e0
commit 5c2426a7b2
10 changed files with 11 additions and 11 deletions

View File

@ -35,7 +35,7 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/net/context" "golang.org/x/net/context"
"k8s.io/apimachinery/pkg/util/clock" "k8s.io/utils/clock"
) )
const ( const (

View File

@ -23,13 +23,13 @@ import (
eventtypes "github.com/containerd/containerd/api/events" eventtypes "github.com/containerd/containerd/api/events"
"github.com/containerd/typeurl" "github.com/containerd/typeurl"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/clock" testingclock "k8s.io/utils/clock/testing"
) )
// TestBackOff tests the logic of backOff struct. // TestBackOff tests the logic of backOff struct.
func TestBackOff(t *testing.T) { func TestBackOff(t *testing.T) {
testStartTime := time.Now() testStartTime := time.Now()
testClock := clock.NewFakeClock(testStartTime) testClock := testingclock.NewFakeClock(testStartTime)
inputQueues := map[string]*backOffQueue{ inputQueues := map[string]*backOffQueue{
"container1": { "container1": {
events: []interface{}{ events: []interface{}{

View File

@ -24,8 +24,8 @@ import (
"sync" "sync"
"time" "time"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/utils/clock"
) )
// For any test of the style: // For any test of the style:

View File

@ -38,7 +38,6 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/clock"
"k8s.io/client-go/pkg/apis/clientauthentication" "k8s.io/client-go/pkg/apis/clientauthentication"
"k8s.io/client-go/pkg/apis/clientauthentication/install" "k8s.io/client-go/pkg/apis/clientauthentication/install"
clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1" clientauthenticationv1 "k8s.io/client-go/pkg/apis/clientauthentication/v1"
@ -49,6 +48,7 @@ import (
"k8s.io/client-go/transport" "k8s.io/client-go/transport"
"k8s.io/client-go/util/connrotation" "k8s.io/client-go/util/connrotation"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"k8s.io/utils/clock"
) )
const execInfoEnv = "KUBERNETES_EXEC_INFO" const execInfoEnv = "KUBERNETES_EXEC_INFO"

View File

@ -39,13 +39,13 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/runtime/serializer/streaming"
utilclock "k8s.io/apimachinery/pkg/util/clock"
"k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
restclientwatch "k8s.io/client-go/rest/watch" restclientwatch "k8s.io/client-go/rest/watch"
"k8s.io/client-go/tools/metrics" "k8s.io/client-go/tools/metrics"
"k8s.io/client-go/util/flowcontrol" "k8s.io/client-go/util/flowcontrol"
"k8s.io/klog/v2" "k8s.io/klog/v2"
utilclock "k8s.io/utils/clock"
) )
var ( var (

View File

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

View File

@ -21,8 +21,8 @@ import (
"sync" "sync"
"time" "time"
"k8s.io/apimachinery/pkg/util/clock"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/utils/clock"
) )
// DelayingInterface is an Interface that can Add an item at a later time. This makes it easier to // DelayingInterface is an Interface that can Add an item at a later time. This makes it easier to

View File

@ -20,7 +20,7 @@ import (
"sync" "sync"
"time" "time"
"k8s.io/apimachinery/pkg/util/clock" "k8s.io/utils/clock"
) )
// This file provides abstractions for setting the provider (e.g., prometheus) // This file provides abstractions for setting the provider (e.g., prometheus)

View File

@ -20,7 +20,7 @@ import (
"sync" "sync"
"time" "time"
"k8s.io/apimachinery/pkg/util/clock" "k8s.io/utils/clock"
) )
type Interface interface { type Interface interface {

2
vendor/modules.txt vendored
View File

@ -611,7 +611,7 @@ k8s.io/apimachinery/pkg/runtime/serializer/streaming
k8s.io/apimachinery/pkg/runtime/serializer/versioning k8s.io/apimachinery/pkg/runtime/serializer/versioning
k8s.io/apimachinery/pkg/selection k8s.io/apimachinery/pkg/selection
k8s.io/apimachinery/pkg/types k8s.io/apimachinery/pkg/types
k8s.io/apimachinery/pkg/util/clock k8s.io/utils/clock
k8s.io/apimachinery/pkg/util/errors k8s.io/apimachinery/pkg/util/errors
k8s.io/apimachinery/pkg/util/framer k8s.io/apimachinery/pkg/util/framer
k8s.io/apimachinery/pkg/util/httpstream k8s.io/apimachinery/pkg/util/httpstream