Vendor: Update k8s version
Signed-off-by: Michał Żyłowski <michal.zylowski@intel.com>
This commit is contained in:
parent
dfa93414c5
commit
52baf68d50
3756 changed files with 113013 additions and 92675 deletions
12
vendor/k8s.io/kubernetes/pkg/storage/BUILD
generated
vendored
12
vendor/k8s.io/kubernetes/pkg/storage/BUILD
generated
vendored
|
@ -23,18 +23,16 @@ go_library(
|
|||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/api/validation/path:go_default_library",
|
||||
"//pkg/client/cache:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/util:go_default_library",
|
||||
"//pkg/util/clock:go_default_library",
|
||||
"//vendor:github.com/golang/glog",
|
||||
"//vendor:golang.org/x/net/context",
|
||||
"//vendor:k8s.io/apimachinery/pkg/api/errors",
|
||||
"//vendor:k8s.io/apimachinery/pkg/api/meta",
|
||||
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"//vendor:k8s.io/apimachinery/pkg/conversion",
|
||||
"//vendor:k8s.io/apimachinery/pkg/fields",
|
||||
"//vendor:k8s.io/apimachinery/pkg/labels",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime",
|
||||
"//vendor:k8s.io/apimachinery/pkg/types",
|
||||
|
@ -42,6 +40,7 @@ go_library(
|
|||
"//vendor:k8s.io/apimachinery/pkg/util/validation/field",
|
||||
"//vendor:k8s.io/apimachinery/pkg/util/wait",
|
||||
"//vendor:k8s.io/apimachinery/pkg/watch",
|
||||
"//vendor:k8s.io/client-go/util/clock",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -58,18 +57,17 @@ go_test(
|
|||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/client/cache:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/util/clock:go_default_library",
|
||||
"//vendor:k8s.io/apimachinery/pkg/api/errors",
|
||||
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"//vendor:k8s.io/apimachinery/pkg/fields",
|
||||
"//vendor:k8s.io/apimachinery/pkg/labels",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
|
||||
"//vendor:k8s.io/apimachinery/pkg/util/sets",
|
||||
"//vendor:k8s.io/apimachinery/pkg/util/wait",
|
||||
"//vendor:k8s.io/apimachinery/pkg/watch",
|
||||
"//vendor:k8s.io/client-go/util/clock",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -81,7 +79,6 @@ go_test(
|
|||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/testapi:go_default_library",
|
||||
"//pkg/api/testing:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/registry/core/pod:go_default_library",
|
||||
"//pkg/storage:go_default_library",
|
||||
"//pkg/storage/etcd:go_default_library",
|
||||
|
@ -92,6 +89,7 @@ go_test(
|
|||
"//vendor:k8s.io/apimachinery/pkg/api/errors",
|
||||
"//vendor:k8s.io/apimachinery/pkg/api/meta",
|
||||
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"//vendor:k8s.io/apimachinery/pkg/fields",
|
||||
"//vendor:k8s.io/apimachinery/pkg/labels",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime",
|
||||
"//vendor:k8s.io/apimachinery/pkg/util/sets",
|
||||
|
|
13
vendor/k8s.io/kubernetes/pkg/storage/cacher.go
generated
vendored
13
vendor/k8s.io/kubernetes/pkg/storage/cacher.go
generated
vendored
|
@ -28,15 +28,14 @@ import (
|
|||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
@ -188,9 +187,9 @@ type Cacher struct {
|
|||
stopWg sync.WaitGroup
|
||||
}
|
||||
|
||||
// Create a new Cacher responsible from service WATCH and LIST requests from its
|
||||
// internal cache and updating its cache in the background based on the given
|
||||
// configuration.
|
||||
// Create a new Cacher responsible for servicing WATCH and LIST requests from
|
||||
// its internal cache and updating its cache in the background based on the
|
||||
// given configuration.
|
||||
func NewCacherFromConfig(config CacherConfig) *Cacher {
|
||||
watchCache := newWatchCache(config.CacheCapacity, config.KeyFunc, config.GetAttrsFunc)
|
||||
listerWatcher := newCacherListerWatcher(config.Storage, config.ResourcePrefix, config.NewListFunc)
|
||||
|
@ -692,7 +691,7 @@ func newCacherListerWatcher(storage Interface, resourcePrefix string, newListFun
|
|||
}
|
||||
|
||||
// Implements cache.ListerWatcher interface.
|
||||
func (lw *cacherListerWatcher) List(options v1.ListOptions) (runtime.Object, error) {
|
||||
func (lw *cacherListerWatcher) List(options metav1.ListOptions) (runtime.Object, error) {
|
||||
list := lw.newListFunc()
|
||||
if err := lw.storage.List(context.TODO(), lw.resourcePrefix, "", Everything, list); err != nil {
|
||||
return nil, err
|
||||
|
@ -701,7 +700,7 @@ func (lw *cacherListerWatcher) List(options v1.ListOptions) (runtime.Object, err
|
|||
}
|
||||
|
||||
// Implements cache.ListerWatcher interface.
|
||||
func (lw *cacherListerWatcher) Watch(options v1.ListOptions) (watch.Interface, error) {
|
||||
func (lw *cacherListerWatcher) Watch(options metav1.ListOptions) (watch.Interface, error) {
|
||||
return lw.storage.WatchList(context.TODO(), lw.resourcePrefix, options.ResourceVersion, Everything)
|
||||
}
|
||||
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/cacher_test.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/cacher_test.go
generated
vendored
|
@ -27,6 +27,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
@ -35,7 +36,6 @@ import (
|
|||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
apitesting "k8s.io/kubernetes/pkg/api/testing"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
corepod "k8s.io/kubernetes/pkg/registry/core/pod"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
etcdstorage "k8s.io/kubernetes/pkg/storage/etcd"
|
||||
|
@ -70,7 +70,7 @@ func newTestCacher(s storage.Interface, cap int) *storage.Cacher {
|
|||
|
||||
func makeTestPod(name string) *api.Pod {
|
||||
return &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Namespace: "ns", Name: name},
|
||||
ObjectMeta: metav1.ObjectMeta{Namespace: "ns", Name: name},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
}
|
||||
}
|
||||
|
|
2
vendor/k8s.io/kubernetes/pkg/storage/cacher_whitebox_test.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/cacher_whitebox_test.go
generated
vendored
|
@ -21,10 +21,10 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
)
|
||||
|
||||
// verifies the cacheWatcher.process goroutine is properly cleaned up even if
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/errors.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/errors.go
generated
vendored
|
@ -105,8 +105,8 @@ func IsUnreachable(err error) bool {
|
|||
return isErrCode(err, ErrCodeUnreachable)
|
||||
}
|
||||
|
||||
// IsTestFailed returns true if and only if err is a write conflict.
|
||||
func IsTestFailed(err error) bool {
|
||||
// IsConflict returns true if and only if err is a write conflict.
|
||||
func IsConflict(err error) bool {
|
||||
return isErrCode(err, ErrCodeResourceVersionConflicts)
|
||||
}
|
||||
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/etcd/BUILD
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/etcd/BUILD
generated
vendored
|
@ -49,15 +49,15 @@ go_test(
|
|||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/testapi:go_default_library",
|
||||
"//pkg/api/testing:go_default_library",
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/storage:go_default_library",
|
||||
"//pkg/storage/etcd/etcdtest:go_default_library",
|
||||
"//pkg/storage/etcd/testing:go_default_library",
|
||||
"//pkg/storage/testing:go_default_library",
|
||||
"//vendor:github.com/coreos/etcd/client",
|
||||
"//vendor:golang.org/x/net/context",
|
||||
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"//vendor:k8s.io/apimachinery/pkg/conversion",
|
||||
"//vendor:k8s.io/apimachinery/pkg/fields",
|
||||
"//vendor:k8s.io/apimachinery/pkg/labels",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime/serializer",
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/etcd/api_object_versioner.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/etcd/api_object_versioner.go
generated
vendored
|
@ -20,8 +20,8 @@ import (
|
|||
"strconv"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
)
|
||||
|
||||
|
@ -45,7 +45,7 @@ func (a APIObjectVersioner) UpdateObject(obj runtime.Object, resourceVersion uin
|
|||
|
||||
// UpdateList implements Versioner
|
||||
func (a APIObjectVersioner) UpdateList(obj runtime.Object, resourceVersion uint64) error {
|
||||
listMeta, err := api.ListMetaFor(obj)
|
||||
listMeta, err := metav1.ListMetaFor(obj)
|
||||
if err != nil || listMeta == nil {
|
||||
return err
|
||||
}
|
||||
|
|
12
vendor/k8s.io/kubernetes/pkg/storage/etcd/api_object_versioner_test.go
generated
vendored
12
vendor/k8s.io/kubernetes/pkg/storage/etcd/api_object_versioner_test.go
generated
vendored
|
@ -19,19 +19,19 @@ package etcd
|
|||
import (
|
||||
"testing"
|
||||
|
||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
storagetesting "k8s.io/kubernetes/pkg/storage/testing"
|
||||
)
|
||||
|
||||
func TestObjectVersioner(t *testing.T) {
|
||||
v := APIObjectVersioner{}
|
||||
if ver, err := v.ObjectResourceVersion(&storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{ResourceVersion: "5"}}); err != nil || ver != 5 {
|
||||
if ver, err := v.ObjectResourceVersion(&storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}); err != nil || ver != 5 {
|
||||
t.Errorf("unexpected version: %d %v", ver, err)
|
||||
}
|
||||
if ver, err := v.ObjectResourceVersion(&storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{ResourceVersion: "a"}}); err == nil || ver != 0 {
|
||||
if ver, err := v.ObjectResourceVersion(&storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "a"}}); err == nil || ver != 0 {
|
||||
t.Errorf("unexpected version: %d %v", ver, err)
|
||||
}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{ResourceVersion: "a"}}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "a"}}
|
||||
if err := v.UpdateObject(obj, 5); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ func TestObjectVersioner(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCompareResourceVersion(t *testing.T) {
|
||||
five := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{ResourceVersion: "5"}}
|
||||
six := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{ResourceVersion: "6"}}
|
||||
five := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "5"}}
|
||||
six := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{ResourceVersion: "6"}}
|
||||
|
||||
versioner := APIObjectVersioner{}
|
||||
|
||||
|
|
3
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_helper.go
generated
vendored
3
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_helper.go
generated
vendored
|
@ -24,6 +24,7 @@ import (
|
|||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
|
@ -131,7 +132,7 @@ func checkPreconditions(key string, preconditions *storage.Preconditions, out ru
|
|||
if preconditions == nil {
|
||||
return nil
|
||||
}
|
||||
objMeta, err := api.ObjectMetaFor(out)
|
||||
objMeta, err := metav1.ObjectMetaFor(out)
|
||||
if err != nil {
|
||||
return storage.NewInternalErrorf("can't enforce preconditions %v on un-introspectable object %v, got error: %v", *preconditions, out, err)
|
||||
}
|
||||
|
|
48
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_helper_test.go
generated
vendored
48
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_helper_test.go
generated
vendored
|
@ -25,15 +25,15 @@ import (
|
|||
|
||||
etcd "github.com/coreos/etcd/client"
|
||||
"golang.org/x/net/context"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
apitesting "k8s.io/kubernetes/pkg/api/testing"
|
||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
"k8s.io/kubernetes/pkg/storage/etcd/etcdtest"
|
||||
etcdtesting "k8s.io/kubernetes/pkg/storage/etcd/testing"
|
||||
|
@ -68,7 +68,7 @@ func newEtcdHelper(client etcd.Client, codec runtime.Codec, prefix string) etcdH
|
|||
// Returns an encoded version of api.Pod with the given name.
|
||||
func getEncodedPod(name string) string {
|
||||
pod, _ := runtime.Encode(testapi.Default.Codec(), &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: name},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: name},
|
||||
})
|
||||
return string(pod)
|
||||
}
|
||||
|
@ -101,15 +101,15 @@ func TestList(t *testing.T) {
|
|||
list := api.PodList{
|
||||
Items: []api.Pod{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "bar"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "baz"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "baz"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
},
|
||||
|
@ -137,15 +137,15 @@ func TestListFiltered(t *testing.T) {
|
|||
list := api.PodList{
|
||||
Items: []api.Pod{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "bar"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "baz"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "baz"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
},
|
||||
|
@ -184,15 +184,15 @@ func TestListAcrossDirectories(t *testing.T) {
|
|||
list := api.PodList{
|
||||
Items: []api.Pod{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "baz"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "baz"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "bar"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "bar"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
},
|
||||
},
|
||||
|
@ -224,7 +224,7 @@ func TestGet(t *testing.T) {
|
|||
key := "/some/key"
|
||||
helper := newEtcdHelper(server.Client, testapi.Default.Codec(), etcdtest.PathPrefix())
|
||||
expect := api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
|
||||
Spec: apitesting.DeepEqualSafePodSpec(),
|
||||
}
|
||||
var got api.Pod
|
||||
|
@ -254,7 +254,7 @@ func TestGetNotFoundErr(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
server := etcdtesting.NewEtcdTestClientServer(t)
|
||||
defer server.Terminate(t)
|
||||
helper := newEtcdHelper(server.Client, testapi.Default.Codec(), etcdtest.PathPrefix())
|
||||
|
@ -281,7 +281,7 @@ func TestCreate(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCreateNilOutParam(t *testing.T) {
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
server := etcdtesting.NewEtcdTestClientServer(t)
|
||||
defer server.Terminate(t)
|
||||
helper := newEtcdHelper(server.Client, testapi.Default.Codec(), etcdtest.PathPrefix())
|
||||
|
@ -298,7 +298,7 @@ func TestGuaranteedUpdate(t *testing.T) {
|
|||
key := "/some/key"
|
||||
helper := newEtcdHelper(server.Client, codec, etcdtest.PathPrefix())
|
||||
|
||||
obj := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
err := helper.GuaranteedUpdate(context.TODO(), key, &storagetesting.TestResource{}, true, nil, storage.SimpleUpdate(func(in runtime.Object) (runtime.Object, error) {
|
||||
return obj, nil
|
||||
}))
|
||||
|
@ -308,7 +308,7 @@ func TestGuaranteedUpdate(t *testing.T) {
|
|||
|
||||
// Update an existing node.
|
||||
callbackCalled := false
|
||||
objUpdate := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: 2}
|
||||
objUpdate := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: 2}
|
||||
err = helper.GuaranteedUpdate(context.TODO(), key, &storagetesting.TestResource{}, true, nil, storage.SimpleUpdate(func(in runtime.Object) (runtime.Object, error) {
|
||||
callbackCalled = true
|
||||
|
||||
|
@ -343,7 +343,7 @@ func TestGuaranteedUpdateNoChange(t *testing.T) {
|
|||
key := "/some/key"
|
||||
helper := newEtcdHelper(server.Client, codec, etcdtest.PathPrefix())
|
||||
|
||||
obj := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
err := helper.GuaranteedUpdate(context.TODO(), key, &storagetesting.TestResource{}, true, nil, storage.SimpleUpdate(func(in runtime.Object) (runtime.Object, error) {
|
||||
return obj, nil
|
||||
}))
|
||||
|
@ -353,7 +353,7 @@ func TestGuaranteedUpdateNoChange(t *testing.T) {
|
|||
|
||||
// Update an existing node with the same data
|
||||
callbackCalled := false
|
||||
objUpdate := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
objUpdate := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
err = helper.GuaranteedUpdate(context.TODO(), key, &storagetesting.TestResource{}, true, nil, storage.SimpleUpdate(func(in runtime.Object) (runtime.Object, error) {
|
||||
callbackCalled = true
|
||||
return objUpdate, nil
|
||||
|
@ -374,7 +374,7 @@ func TestGuaranteedUpdateKeyNotFound(t *testing.T) {
|
|||
helper := newEtcdHelper(server.Client, codec, etcdtest.PathPrefix())
|
||||
|
||||
// Create a new node.
|
||||
obj := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: 1}
|
||||
|
||||
f := storage.SimpleUpdate(func(in runtime.Object) (runtime.Object, error) {
|
||||
return obj, nil
|
||||
|
@ -422,7 +422,7 @@ func TestGuaranteedUpdate_CreateCollision(t *testing.T) {
|
|||
}
|
||||
|
||||
currValue := in.(*storagetesting.TestResource).Value
|
||||
obj := &storagetesting.TestResource{ObjectMeta: apiv1.ObjectMeta{Name: "foo"}, Value: currValue + 1}
|
||||
obj := &storagetesting.TestResource{ObjectMeta: metav1.ObjectMeta{Name: "foo"}, Value: currValue + 1}
|
||||
return obj, nil
|
||||
}))
|
||||
if err != nil {
|
||||
|
@ -448,7 +448,7 @@ func TestGuaranteedUpdateUIDMismatch(t *testing.T) {
|
|||
prefix := path.Join("/", etcdtest.PathPrefix())
|
||||
helper := newEtcdHelper(server.Client, testapi.Default.Codec(), prefix)
|
||||
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
podPtr := &api.Pod{}
|
||||
err := helper.Create(context.TODO(), "/some/key", obj, podPtr, 0)
|
||||
if err != nil {
|
||||
|
@ -468,7 +468,7 @@ func TestDeleteUIDMismatch(t *testing.T) {
|
|||
prefix := path.Join("/", etcdtest.PathPrefix())
|
||||
helper := newEtcdHelper(server.Client, testapi.Default.Codec(), prefix)
|
||||
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
podPtr := &api.Pod{}
|
||||
err := helper.Create(context.TODO(), "/some/key", obj, podPtr, 0)
|
||||
if err != nil {
|
||||
|
@ -507,7 +507,7 @@ func TestDeleteWithRetry(t *testing.T) {
|
|||
defer server.Terminate(t)
|
||||
prefix := path.Join("/", etcdtest.PathPrefix())
|
||||
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}}
|
||||
// fakeGet returns a large ModifiedIndex to emulate the case that another
|
||||
// party has updated the object.
|
||||
fakeGet := func(ctx context.Context, key string, opts *etcd.GetOptions) (*etcd.Response, error) {
|
||||
|
|
21
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_watcher_test.go
generated
vendored
21
vendor/k8s.io/kubernetes/pkg/storage/etcd/etcd_watcher_test.go
generated
vendored
|
@ -20,6 +20,7 @@ import (
|
|||
rt "runtime"
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
|
@ -49,9 +50,9 @@ var _ etcdCache = &fakeEtcdCache{}
|
|||
func TestWatchInterpretations(t *testing.T) {
|
||||
codec := testapi.Default.Codec()
|
||||
// Declare some pods to make the test cases compact.
|
||||
podFoo := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
podBar := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}
|
||||
podBaz := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "baz"}}
|
||||
podFoo := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
podBar := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}
|
||||
podBaz := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "baz"}}
|
||||
|
||||
// All of these test cases will be run with the firstLetterIsB Filter.
|
||||
table := map[string]struct {
|
||||
|
@ -229,8 +230,8 @@ func TestSendResultDeleteEventHaveLatestIndex(t *testing.T) {
|
|||
eventChan <- e
|
||||
}
|
||||
|
||||
fooPod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
barPod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}
|
||||
fooPod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
barPod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}
|
||||
fooBytes, err := runtime.Encode(codec, fooPod)
|
||||
if err != nil {
|
||||
t.Fatalf("Encode failed: %v", err)
|
||||
|
@ -299,7 +300,7 @@ func TestWatch(t *testing.T) {
|
|||
// watching is explicitly closed below.
|
||||
|
||||
// Test normal case
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
pod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
returnObj := &api.Pod{}
|
||||
err = h.Create(context.TODO(), key, pod, returnObj, 0)
|
||||
if err != nil {
|
||||
|
@ -353,7 +354,7 @@ func TestWatchEtcdState(t *testing.T) {
|
|||
defer watching.Stop()
|
||||
|
||||
endpoint := &api.Endpoints{
|
||||
ObjectMeta: api.ObjectMeta{Name: "foo"},
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
|
||||
Subsets: emptySubsets(),
|
||||
}
|
||||
|
||||
|
@ -397,7 +398,7 @@ func TestWatchEtcdState(t *testing.T) {
|
|||
|
||||
func TestWatchFromZeroIndex(t *testing.T) {
|
||||
codec := testapi.Default.Codec()
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
pod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
|
||||
key := "/somekey/foo"
|
||||
server := etcdtesting.NewEtcdTestClientServer(t)
|
||||
|
@ -482,7 +483,7 @@ func TestWatchListFromZeroIndex(t *testing.T) {
|
|||
defer watching.Stop()
|
||||
|
||||
// creates foo which should trigger the WatchList for "/"
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
pod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
err = h.Create(context.TODO(), pod.Name, pod, pod, 0)
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
|
@ -500,7 +501,7 @@ func TestWatchListFromZeroIndex(t *testing.T) {
|
|||
|
||||
func TestWatchListIgnoresRootKey(t *testing.T) {
|
||||
codec := testapi.Default.Codec()
|
||||
pod := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
pod := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
key := "/some/key"
|
||||
server := etcdtesting.NewEtcdTestClientServer(t)
|
||||
defer server.Terminate(t)
|
||||
|
|
3
vendor/k8s.io/kubernetes/pkg/storage/etcd3/BUILD
generated
vendored
3
vendor/k8s.io/kubernetes/pkg/storage/etcd3/BUILD
generated
vendored
|
@ -18,7 +18,6 @@ go_library(
|
|||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/storage:go_default_library",
|
||||
"//pkg/storage/etcd:go_default_library",
|
||||
"//pkg/util:go_default_library",
|
||||
|
@ -47,13 +46,13 @@ go_test(
|
|||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/testapi:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/storage:go_default_library",
|
||||
"//vendor:github.com/coreos/etcd/clientv3",
|
||||
"//vendor:github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes",
|
||||
"//vendor:github.com/coreos/etcd/integration",
|
||||
"//vendor:golang.org/x/net/context",
|
||||
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
|
||||
"//vendor:k8s.io/apimachinery/pkg/fields",
|
||||
"//vendor:k8s.io/apimachinery/pkg/labels",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime",
|
||||
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/etcd3/store.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/etcd3/store.go
generated
vendored
|
@ -26,10 +26,10 @@ import (
|
|||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/conversion"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
"k8s.io/kubernetes/pkg/storage/etcd"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
|
@ -497,7 +497,7 @@ func checkPreconditions(key string, preconditions *storage.Preconditions, out ru
|
|||
if preconditions == nil {
|
||||
return nil
|
||||
}
|
||||
objMeta, err := api.ObjectMetaFor(out)
|
||||
objMeta, err := metav1.ObjectMetaFor(out)
|
||||
if err != nil {
|
||||
return storage.NewInternalErrorf("can't enforce preconditions %v on un-introspectable object %v, got error: %v", *preconditions, out, err)
|
||||
}
|
||||
|
|
31
vendor/k8s.io/kubernetes/pkg/storage/etcd3/store_test.go
generated
vendored
31
vendor/k8s.io/kubernetes/pkg/storage/etcd3/store_test.go
generated
vendored
|
@ -22,11 +22,12 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
|
||||
"github.com/coreos/etcd/integration"
|
||||
|
@ -41,7 +42,7 @@ func TestCreate(t *testing.T) {
|
|||
|
||||
key := "/testkey"
|
||||
out := &api.Pod{}
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
|
||||
// verify that kv pair is empty before set
|
||||
getResp, err := etcdClient.KV.Get(ctx, key)
|
||||
|
@ -78,7 +79,7 @@ func TestCreateWithTTL(t *testing.T) {
|
|||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
|
||||
input := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
input := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
key := "/somekey"
|
||||
|
||||
out := &api.Pod{}
|
||||
|
@ -96,7 +97,7 @@ func TestCreateWithTTL(t *testing.T) {
|
|||
func TestCreateWithKeyExist(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
obj := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
obj := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
key, _ := testPropogateStore(ctx, t, store, obj)
|
||||
out := &api.Pod{}
|
||||
err := store.Create(ctx, key, obj, out, 0)
|
||||
|
@ -108,7 +109,7 @@ func TestCreateWithKeyExist(t *testing.T) {
|
|||
func TestGet(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
tests := []struct {
|
||||
key string
|
||||
|
@ -152,7 +153,7 @@ func TestGet(t *testing.T) {
|
|||
func TestUnconditionalDelete(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
tests := []struct {
|
||||
key string
|
||||
|
@ -189,7 +190,7 @@ func TestUnconditionalDelete(t *testing.T) {
|
|||
func TestConditionalDelete(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
|
||||
tests := []struct {
|
||||
precondition *storage.Preconditions
|
||||
|
@ -217,14 +218,14 @@ func TestConditionalDelete(t *testing.T) {
|
|||
if !reflect.DeepEqual(storedObj, out) {
|
||||
t.Errorf("#%d: pod want=%#v, get=%#v", i, storedObj, out)
|
||||
}
|
||||
key, storedObj = testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
key, storedObj = testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetToList(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
tests := []struct {
|
||||
key string
|
||||
|
@ -273,7 +274,7 @@ func TestGetToList(t *testing.T) {
|
|||
func TestGuaranteedUpdate(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storeObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
key, storeObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", UID: "A"}})
|
||||
|
||||
tests := []struct {
|
||||
key string
|
||||
|
@ -381,7 +382,7 @@ func TestGuaranteedUpdateWithTTL(t *testing.T) {
|
|||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
|
||||
input := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
input := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
key := "/somekey"
|
||||
|
||||
out := &api.Pod{}
|
||||
|
@ -404,7 +405,7 @@ func TestGuaranteedUpdateWithTTL(t *testing.T) {
|
|||
func TestGuaranteedUpdateWithConflict(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, _ := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, _ := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
errChan := make(chan error, 1)
|
||||
var firstToFinish sync.WaitGroup
|
||||
|
@ -471,13 +472,13 @@ func TestList(t *testing.T) {
|
|||
storedObj *api.Pod
|
||||
}{{
|
||||
key: "/one-level/test",
|
||||
obj: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}},
|
||||
obj: &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}},
|
||||
}, {
|
||||
key: "/two-level/1/test",
|
||||
obj: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}},
|
||||
obj: &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}},
|
||||
}, {
|
||||
key: "/two-level/2/test",
|
||||
obj: &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}},
|
||||
obj: &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}},
|
||||
}}
|
||||
|
||||
for i, ps := range preset {
|
||||
|
|
22
vendor/k8s.io/kubernetes/pkg/storage/etcd3/watcher_test.go
generated
vendored
22
vendor/k8s.io/kubernetes/pkg/storage/etcd3/watcher_test.go
generated
vendored
|
@ -29,6 +29,7 @@ import (
|
|||
"github.com/coreos/etcd/integration"
|
||||
"golang.org/x/net/context"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
@ -36,7 +37,6 @@ import (
|
|||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/storage"
|
||||
)
|
||||
|
||||
|
@ -55,8 +55,8 @@ func TestWatchList(t *testing.T) {
|
|||
func testWatch(t *testing.T, recursive bool) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
podFoo := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
podBar := &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}
|
||||
podFoo := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}
|
||||
podBar := &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}
|
||||
|
||||
tests := []struct {
|
||||
key string
|
||||
|
@ -130,7 +130,7 @@ func testWatch(t *testing.T, recursive bool) {
|
|||
func TestDeleteTriggerWatch(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
w, err := store.Watch(ctx, key, storedObj.ResourceVersion, storage.Everything)
|
||||
if err != nil {
|
||||
t.Fatalf("Watch failed: %v", err)
|
||||
|
@ -147,7 +147,7 @@ func TestDeleteTriggerWatch(t *testing.T) {
|
|||
func TestWatchFromZero(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "ns"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns"}})
|
||||
|
||||
w, err := store.Watch(ctx, key, "0", storage.Everything)
|
||||
if err != nil {
|
||||
|
@ -160,7 +160,7 @@ func TestWatchFromZero(t *testing.T) {
|
|||
out := &api.Pod{}
|
||||
err = store.GuaranteedUpdate(ctx, key, out, true, nil, storage.SimpleUpdate(
|
||||
func(runtime.Object) (runtime.Object, error) {
|
||||
return &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "ns", Annotations: map[string]string{"a": "1"}}}, nil
|
||||
return &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns", Annotations: map[string]string{"a": "1"}}}, nil
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("GuaranteedUpdate failed: %v", err)
|
||||
|
@ -178,7 +178,7 @@ func TestWatchFromZero(t *testing.T) {
|
|||
out = &api.Pod{}
|
||||
err = store.GuaranteedUpdate(ctx, key, out, true, nil, storage.SimpleUpdate(
|
||||
func(runtime.Object) (runtime.Object, error) {
|
||||
return &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "ns"}}, nil
|
||||
return &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns"}}, nil
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatalf("GuaranteedUpdate failed: %v", err)
|
||||
|
@ -207,7 +207,7 @@ func TestWatchFromZero(t *testing.T) {
|
|||
func TestWatchFromNoneZero(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
w, err := store.Watch(ctx, key, storedObj.ResourceVersion, storage.Everything)
|
||||
if err != nil {
|
||||
|
@ -216,7 +216,7 @@ func TestWatchFromNoneZero(t *testing.T) {
|
|||
out := &api.Pod{}
|
||||
store.GuaranteedUpdate(ctx, key, out, true, nil, storage.SimpleUpdate(
|
||||
func(runtime.Object) (runtime.Object, error) {
|
||||
return &api.Pod{ObjectMeta: api.ObjectMeta{Name: "bar"}}, err
|
||||
return &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}, err
|
||||
}))
|
||||
testCheckResult(t, 0, watch.Modified, w, out)
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ func TestWatchError(t *testing.T) {
|
|||
validStore := newStore(cluster.RandClient(), false, testapi.Default.Codec(), "")
|
||||
validStore.GuaranteedUpdate(ctx, "/abc", &api.Pod{}, true, nil, storage.SimpleUpdate(
|
||||
func(runtime.Object) (runtime.Object, error) {
|
||||
return &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}}, nil
|
||||
return &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}, nil
|
||||
}))
|
||||
testCheckEventType(t, watch.Error, w)
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ func TestWatchErrResultNotBlockAfterCancel(t *testing.T) {
|
|||
func TestWatchDeleteEventObjectHaveLatestRV(t *testing.T) {
|
||||
ctx, store, cluster := testSetup(t)
|
||||
defer cluster.Terminate(t)
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: api.ObjectMeta{Name: "foo"}})
|
||||
key, storedObj := testPropogateStore(ctx, t, store, &api.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}})
|
||||
|
||||
w, err := store.Watch(ctx, key, storedObj.ResourceVersion, storage.Everything)
|
||||
if err != nil {
|
||||
|
|
2
vendor/k8s.io/kubernetes/pkg/storage/interfaces.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/interfaces.go
generated
vendored
|
@ -18,11 +18,11 @@ package storage
|
|||
|
||||
import (
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
)
|
||||
|
||||
// Versioner abstracts setting and retrieving metadata fields from database response
|
||||
|
|
2
vendor/k8s.io/kubernetes/pkg/storage/selection_predicate.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/selection_predicate.go
generated
vendored
|
@ -17,9 +17,9 @@ limitations under the License.
|
|||
package storage
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
)
|
||||
|
||||
// AttrFunc returns label and field sets for List or Watch to match.
|
||||
|
|
2
vendor/k8s.io/kubernetes/pkg/storage/selection_predicate_test.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/selection_predicate_test.go
generated
vendored
|
@ -20,10 +20,10 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
)
|
||||
|
||||
type Ignored struct {
|
||||
|
|
2
vendor/k8s.io/kubernetes/pkg/storage/storagebackend/factory/tls_test.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/storage/storagebackend/factory/tls_test.go
generated
vendored
|
@ -20,6 +20,7 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
|
@ -35,6 +36,7 @@ import (
|
|||
|
||||
func TestTLSConnection(t *testing.T) {
|
||||
certFile, keyFile, caFile := configureTLSCerts(t)
|
||||
defer os.RemoveAll(filepath.Dir(certFile))
|
||||
|
||||
tlsInfo := &transport.TLSInfo{
|
||||
CertFile: certFile,
|
||||
|
|
1
vendor/k8s.io/kubernetes/pkg/storage/testing/BUILD
generated
vendored
1
vendor/k8s.io/kubernetes/pkg/storage/testing/BUILD
generated
vendored
|
@ -16,7 +16,6 @@ go_library(
|
|||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/storage:go_default_library",
|
||||
"//vendor:github.com/ugorji/go/codec",
|
||||
"//vendor:golang.org/x/net/context",
|
||||
|
|
138
vendor/k8s.io/kubernetes/pkg/storage/testing/types.generated.go
generated
vendored
138
vendor/k8s.io/kubernetes/pkg/storage/testing/types.generated.go
generated
vendored
|
@ -26,8 +26,7 @@ import (
|
|||
"fmt"
|
||||
codec1978 "github.com/ugorji/go/codec"
|
||||
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
pkg3_types "k8s.io/apimachinery/pkg/types"
|
||||
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
pkg2_types "k8s.io/apimachinery/pkg/types"
|
||||
"reflect"
|
||||
"runtime"
|
||||
time "time"
|
||||
|
@ -64,10 +63,9 @@ func init() {
|
|||
}
|
||||
if false { // reference the types, but skip this branch at build/run time
|
||||
var v0 pkg1_v1.TypeMeta
|
||||
var v1 pkg3_types.UID
|
||||
var v2 pkg2_v1.ObjectMeta
|
||||
var v3 time.Time
|
||||
_, _, _, _ = v0, v1, v2, v3
|
||||
var v1 pkg2_types.UID
|
||||
var v2 time.Time
|
||||
_, _, _ = v0, v1, v2
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,13 +154,25 @@ func (x *TestResource) CodecEncodeSelf(e *codec1978.Encoder) {
|
|||
if yyr2 || yy2arr2 {
|
||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||
yy10 := &x.ObjectMeta
|
||||
yy10.CodecEncodeSelf(e)
|
||||
yym11 := z.EncBinary()
|
||||
_ = yym11
|
||||
if false {
|
||||
} else if z.HasExtensions() && z.EncExt(yy10) {
|
||||
} else {
|
||||
z.EncFallback(yy10)
|
||||
}
|
||||
} else {
|
||||
z.EncSendContainerState(codecSelfer_containerMapKey1234)
|
||||
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
|
||||
z.EncSendContainerState(codecSelfer_containerMapValue1234)
|
||||
yy12 := &x.ObjectMeta
|
||||
yy12.CodecEncodeSelf(e)
|
||||
yym13 := z.EncBinary()
|
||||
_ = yym13
|
||||
if false {
|
||||
} else if z.HasExtensions() && z.EncExt(yy12) {
|
||||
} else {
|
||||
z.EncFallback(yy12)
|
||||
}
|
||||
}
|
||||
if yyr2 || yy2arr2 {
|
||||
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
|
||||
|
@ -270,21 +280,27 @@ func (x *TestResource) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
|
|||
}
|
||||
case "metadata":
|
||||
if r.TryDecodeAsNil() {
|
||||
x.ObjectMeta = pkg2_v1.ObjectMeta{}
|
||||
x.ObjectMeta = pkg1_v1.ObjectMeta{}
|
||||
} else {
|
||||
yyv8 := &x.ObjectMeta
|
||||
yyv8.CodecDecodeSelf(d)
|
||||
yym9 := z.DecBinary()
|
||||
_ = yym9
|
||||
if false {
|
||||
} else if z.HasExtensions() && z.DecExt(yyv8) {
|
||||
} else {
|
||||
z.DecFallback(yyv8, false)
|
||||
}
|
||||
}
|
||||
case "value":
|
||||
if r.TryDecodeAsNil() {
|
||||
x.Value = 0
|
||||
} else {
|
||||
yyv9 := &x.Value
|
||||
yym10 := z.DecBinary()
|
||||
_ = yym10
|
||||
yyv10 := &x.Value
|
||||
yym11 := z.DecBinary()
|
||||
_ = yym11
|
||||
if false {
|
||||
} else {
|
||||
*((*int)(yyv9)) = int(r.DecodeInt(codecSelferBitsize1234))
|
||||
*((*int)(yyv10)) = int(r.DecodeInt(codecSelferBitsize1234))
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
@ -298,16 +314,16 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||
var h codecSelfer1234
|
||||
z, r := codec1978.GenHelperDecoder(d)
|
||||
_, _, _ = h, z, r
|
||||
var yyj11 int
|
||||
var yyb11 bool
|
||||
var yyhl11 bool = l >= 0
|
||||
yyj11++
|
||||
if yyhl11 {
|
||||
yyb11 = yyj11 > l
|
||||
var yyj12 int
|
||||
var yyb12 bool
|
||||
var yyhl12 bool = l >= 0
|
||||
yyj12++
|
||||
if yyhl12 {
|
||||
yyb12 = yyj12 > l
|
||||
} else {
|
||||
yyb11 = r.CheckBreak()
|
||||
yyb12 = r.CheckBreak()
|
||||
}
|
||||
if yyb11 {
|
||||
if yyb12 {
|
||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||
return
|
||||
}
|
||||
|
@ -315,21 +331,21 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||
if r.TryDecodeAsNil() {
|
||||
x.Kind = ""
|
||||
} else {
|
||||
yyv12 := &x.Kind
|
||||
yym13 := z.DecBinary()
|
||||
_ = yym13
|
||||
yyv13 := &x.Kind
|
||||
yym14 := z.DecBinary()
|
||||
_ = yym14
|
||||
if false {
|
||||
} else {
|
||||
*((*string)(yyv12)) = r.DecodeString()
|
||||
*((*string)(yyv13)) = r.DecodeString()
|
||||
}
|
||||
}
|
||||
yyj11++
|
||||
if yyhl11 {
|
||||
yyb11 = yyj11 > l
|
||||
yyj12++
|
||||
if yyhl12 {
|
||||
yyb12 = yyj12 > l
|
||||
} else {
|
||||
yyb11 = r.CheckBreak()
|
||||
yyb12 = r.CheckBreak()
|
||||
}
|
||||
if yyb11 {
|
||||
if yyb12 {
|
||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||
return
|
||||
}
|
||||
|
@ -337,38 +353,44 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||
if r.TryDecodeAsNil() {
|
||||
x.APIVersion = ""
|
||||
} else {
|
||||
yyv14 := &x.APIVersion
|
||||
yym15 := z.DecBinary()
|
||||
_ = yym15
|
||||
yyv15 := &x.APIVersion
|
||||
yym16 := z.DecBinary()
|
||||
_ = yym16
|
||||
if false {
|
||||
} else {
|
||||
*((*string)(yyv14)) = r.DecodeString()
|
||||
*((*string)(yyv15)) = r.DecodeString()
|
||||
}
|
||||
}
|
||||
yyj11++
|
||||
if yyhl11 {
|
||||
yyb11 = yyj11 > l
|
||||
yyj12++
|
||||
if yyhl12 {
|
||||
yyb12 = yyj12 > l
|
||||
} else {
|
||||
yyb11 = r.CheckBreak()
|
||||
yyb12 = r.CheckBreak()
|
||||
}
|
||||
if yyb11 {
|
||||
if yyb12 {
|
||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||
return
|
||||
}
|
||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||
if r.TryDecodeAsNil() {
|
||||
x.ObjectMeta = pkg2_v1.ObjectMeta{}
|
||||
x.ObjectMeta = pkg1_v1.ObjectMeta{}
|
||||
} else {
|
||||
yyv16 := &x.ObjectMeta
|
||||
yyv16.CodecDecodeSelf(d)
|
||||
yyv17 := &x.ObjectMeta
|
||||
yym18 := z.DecBinary()
|
||||
_ = yym18
|
||||
if false {
|
||||
} else if z.HasExtensions() && z.DecExt(yyv17) {
|
||||
} else {
|
||||
z.DecFallback(yyv17, false)
|
||||
}
|
||||
}
|
||||
yyj11++
|
||||
if yyhl11 {
|
||||
yyb11 = yyj11 > l
|
||||
yyj12++
|
||||
if yyhl12 {
|
||||
yyb12 = yyj12 > l
|
||||
} else {
|
||||
yyb11 = r.CheckBreak()
|
||||
yyb12 = r.CheckBreak()
|
||||
}
|
||||
if yyb11 {
|
||||
if yyb12 {
|
||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||
return
|
||||
}
|
||||
|
@ -376,26 +398,26 @@ func (x *TestResource) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
|
|||
if r.TryDecodeAsNil() {
|
||||
x.Value = 0
|
||||
} else {
|
||||
yyv17 := &x.Value
|
||||
yym18 := z.DecBinary()
|
||||
_ = yym18
|
||||
yyv19 := &x.Value
|
||||
yym20 := z.DecBinary()
|
||||
_ = yym20
|
||||
if false {
|
||||
} else {
|
||||
*((*int)(yyv17)) = int(r.DecodeInt(codecSelferBitsize1234))
|
||||
*((*int)(yyv19)) = int(r.DecodeInt(codecSelferBitsize1234))
|
||||
}
|
||||
}
|
||||
for {
|
||||
yyj11++
|
||||
if yyhl11 {
|
||||
yyb11 = yyj11 > l
|
||||
yyj12++
|
||||
if yyhl12 {
|
||||
yyb12 = yyj12 > l
|
||||
} else {
|
||||
yyb11 = r.CheckBreak()
|
||||
yyb12 = r.CheckBreak()
|
||||
}
|
||||
if yyb11 {
|
||||
if yyb12 {
|
||||
break
|
||||
}
|
||||
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
|
||||
z.DecStructFieldNotFound(yyj11-1, "")
|
||||
z.DecStructFieldNotFound(yyj12-1, "")
|
||||
}
|
||||
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
|
||||
}
|
||||
|
|
7
vendor/k8s.io/kubernetes/pkg/storage/testing/types.go
generated
vendored
7
vendor/k8s.io/kubernetes/pkg/storage/testing/types.go
generated
vendored
|
@ -19,13 +19,12 @@ package testing
|
|||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
apiv1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
)
|
||||
|
||||
type TestResource struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
apiv1.ObjectMeta `json:"metadata"`
|
||||
Value int `json:"value"`
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata"`
|
||||
Value int `json:"value"`
|
||||
}
|
||||
|
||||
func (obj *TestResource) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
|
|
4
vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go
generated
vendored
4
vendor/k8s.io/kubernetes/pkg/storage/watch_cache.go
generated
vendored
|
@ -25,13 +25,13 @@ import (
|
|||
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/util/clock"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
"k8s.io/kubernetes/pkg/util/clock"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
19
vendor/k8s.io/kubernetes/pkg/storage/watch_cache_test.go
generated
vendored
19
vendor/k8s.io/kubernetes/pkg/storage/watch_cache_test.go
generated
vendored
|
@ -23,21 +23,20 @@ import (
|
|||
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/fields"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/util/clock"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/client/cache"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/util/clock"
|
||||
)
|
||||
|
||||
func makeTestPod(name string, resourceVersion uint64) *api.Pod {
|
||||
return &api.Pod{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Namespace: "ns",
|
||||
Name: name,
|
||||
ResourceVersion: strconv.FormatUint(resourceVersion, 10),
|
||||
|
@ -318,14 +317,14 @@ func TestWaitUntilFreshAndListTimeout(t *testing.T) {
|
|||
}
|
||||
|
||||
type testLW struct {
|
||||
ListFunc func(options v1.ListOptions) (runtime.Object, error)
|
||||
WatchFunc func(options v1.ListOptions) (watch.Interface, error)
|
||||
ListFunc func(options metav1.ListOptions) (runtime.Object, error)
|
||||
WatchFunc func(options metav1.ListOptions) (watch.Interface, error)
|
||||
}
|
||||
|
||||
func (t *testLW) List(options v1.ListOptions) (runtime.Object, error) {
|
||||
func (t *testLW) List(options metav1.ListOptions) (runtime.Object, error) {
|
||||
return t.ListFunc(options)
|
||||
}
|
||||
func (t *testLW) Watch(options v1.ListOptions) (watch.Interface, error) {
|
||||
func (t *testLW) Watch(options metav1.ListOptions) (watch.Interface, error) {
|
||||
return t.WatchFunc(options)
|
||||
}
|
||||
|
||||
|
@ -343,12 +342,12 @@ func TestReflectorForWatchCache(t *testing.T) {
|
|||
}
|
||||
|
||||
lw := &testLW{
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
fw := watch.NewFake()
|
||||
go fw.Stop()
|
||||
return fw, nil
|
||||
},
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
return &api.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}, nil
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue