move testing/core to client-go

This commit is contained in:
deads2k 2017-01-25 15:07:10 -05:00
parent 76ce7bcbd8
commit 9488e2ba30
337 changed files with 1506 additions and 2777 deletions

View File

@ -19,11 +19,11 @@ go_library(
"//cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1:go_default_library",
"//cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1/fake:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,11 +21,11 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/clientset"
v1alpha1apiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1"
fakev1alpha1apiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1/fake"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -33,17 +33,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -52,7 +52,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//cmd/kube-aggregator/pkg/apis/apiregistration/v1alpha1:go_default_library",
"//cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1alpha1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeApiregistrationV1alpha1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeApiregistrationV1alpha1) APIServices() v1alpha1.APIServiceInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration/v1alpha1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeAPIServices implements APIServiceInterface
@ -35,7 +35,7 @@ var apiservicesResource = schema.GroupVersionResource{Group: "apiregistration.k8
func (c *FakeAPIServices) Create(aPIService *v1alpha1.APIService) (result *v1alpha1.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(apiservicesResource, aPIService), &v1alpha1.APIService{})
Invokes(testing.NewRootCreateAction(apiservicesResource, aPIService), &v1alpha1.APIService{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeAPIServices) Create(aPIService *v1alpha1.APIService) (result *v1alp
func (c *FakeAPIServices) Update(aPIService *v1alpha1.APIService) (result *v1alpha1.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(apiservicesResource, aPIService), &v1alpha1.APIService{})
Invokes(testing.NewRootUpdateAction(apiservicesResource, aPIService), &v1alpha1.APIService{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeAPIServices) Update(aPIService *v1alpha1.APIService) (result *v1alp
func (c *FakeAPIServices) UpdateStatus(aPIService *v1alpha1.APIService) (*v1alpha1.APIService, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(apiservicesResource, "status", aPIService), &v1alpha1.APIService{})
Invokes(testing.NewRootUpdateSubresourceAction(apiservicesResource, "status", aPIService), &v1alpha1.APIService{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeAPIServices) UpdateStatus(aPIService *v1alpha1.APIService) (*v1alph
func (c *FakeAPIServices) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(apiservicesResource, name), &v1alpha1.APIService{})
Invokes(testing.NewRootDeleteAction(apiservicesResource, name), &v1alpha1.APIService{})
return err
}
func (c *FakeAPIServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(apiservicesResource, listOptions)
action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.APIServiceList{})
return err
@ -75,7 +75,7 @@ func (c *FakeAPIServices) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeAPIServices) Get(name string, options v1.GetOptions) (result *v1alpha1.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(apiservicesResource, name), &v1alpha1.APIService{})
Invokes(testing.NewRootGetAction(apiservicesResource, name), &v1alpha1.APIService{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeAPIServices) Get(name string, options v1.GetOptions) (result *v1alp
func (c *FakeAPIServices) List(opts v1.ListOptions) (result *v1alpha1.APIServiceList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(apiservicesResource, opts), &v1alpha1.APIServiceList{})
Invokes(testing.NewRootListAction(apiservicesResource, opts), &v1alpha1.APIServiceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeAPIServices) List(opts v1.ListOptions) (result *v1alpha1.APIService
// Watch returns a watch.Interface that watches the requested aPIServices.
func (c *FakeAPIServices) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(apiservicesResource, opts))
InvokesWatch(testing.NewRootWatchAction(apiservicesResource, opts))
}
// Patch applies the patch and returns the patched aPIService.
func (c *FakeAPIServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(apiservicesResource, name, data, subresources...), &v1alpha1.APIService{})
Invokes(testing.NewRootPatchSubresourceAction(apiservicesResource, name, data, subresources...), &v1alpha1.APIService{})
if obj == nil {
return nil, err
}

View File

@ -19,11 +19,11 @@ go_library(
"//cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion:go_default_library",
"//cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion/fake:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,11 +21,11 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset"
internalversionapiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion"
fakeinternalversionapiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion/fake"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -33,17 +33,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -52,7 +52,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//cmd/kube-aggregator/pkg/apis/apiregistration:go_default_library",
"//cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/cmd/kube-aggregator/pkg/client/clientset_generated/internalclientset/typed/apiregistration/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeApiregistration struct {
*core.Fake
*testing.Fake
}
func (c *FakeApiregistration) APIServices() internalversion.APIServiceInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
apiregistration "k8s.io/kubernetes/cmd/kube-aggregator/pkg/apis/apiregistration"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeAPIServices implements APIServiceInterface
@ -35,7 +35,7 @@ var apiservicesResource = schema.GroupVersionResource{Group: "apiregistration.k8
func (c *FakeAPIServices) Create(aPIService *apiregistration.APIService) (result *apiregistration.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(apiservicesResource, aPIService), &apiregistration.APIService{})
Invokes(testing.NewRootCreateAction(apiservicesResource, aPIService), &apiregistration.APIService{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeAPIServices) Create(aPIService *apiregistration.APIService) (result
func (c *FakeAPIServices) Update(aPIService *apiregistration.APIService) (result *apiregistration.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(apiservicesResource, aPIService), &apiregistration.APIService{})
Invokes(testing.NewRootUpdateAction(apiservicesResource, aPIService), &apiregistration.APIService{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeAPIServices) Update(aPIService *apiregistration.APIService) (result
func (c *FakeAPIServices) UpdateStatus(aPIService *apiregistration.APIService) (*apiregistration.APIService, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(apiservicesResource, "status", aPIService), &apiregistration.APIService{})
Invokes(testing.NewRootUpdateSubresourceAction(apiservicesResource, "status", aPIService), &apiregistration.APIService{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeAPIServices) UpdateStatus(aPIService *apiregistration.APIService) (
func (c *FakeAPIServices) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(apiservicesResource, name), &apiregistration.APIService{})
Invokes(testing.NewRootDeleteAction(apiservicesResource, name), &apiregistration.APIService{})
return err
}
func (c *FakeAPIServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(apiservicesResource, listOptions)
action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOptions)
_, err := c.Fake.Invokes(action, &apiregistration.APIServiceList{})
return err
@ -75,7 +75,7 @@ func (c *FakeAPIServices) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeAPIServices) Get(name string, options v1.GetOptions) (result *apiregistration.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(apiservicesResource, name), &apiregistration.APIService{})
Invokes(testing.NewRootGetAction(apiservicesResource, name), &apiregistration.APIService{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeAPIServices) Get(name string, options v1.GetOptions) (result *apire
func (c *FakeAPIServices) List(opts v1.ListOptions) (result *apiregistration.APIServiceList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(apiservicesResource, opts), &apiregistration.APIServiceList{})
Invokes(testing.NewRootListAction(apiservicesResource, opts), &apiregistration.APIServiceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeAPIServices) List(opts v1.ListOptions) (result *apiregistration.API
// Watch returns a watch.Interface that watches the requested aPIServices.
func (c *FakeAPIServices) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(apiservicesResource, opts))
InvokesWatch(testing.NewRootWatchAction(apiservicesResource, opts))
}
// Patch applies the patch and returns the patched aPIService.
func (c *FakeAPIServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiregistration.APIService, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(apiservicesResource, name, data, subresources...), &apiregistration.APIService{})
Invokes(testing.NewRootPatchSubresourceAction(apiservicesResource, name, data, subresources...), &apiregistration.APIService{})
if obj == nil {
return nil, err
}

View File

@ -70,7 +70,7 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) {
// imports for the code in commonTemplate
imports = append(imports,
"k8s.io/kubernetes/pkg/api",
"k8s.io/kubernetes/pkg/client/testing/core",
"k8s.io/client-go/testing",
"k8s.io/client-go/discovery",
"fakediscovery \"k8s.io/client-go/discovery/fake\"",
"k8s.io/apimachinery/pkg/runtime",
@ -109,17 +109,17 @@ var common = `
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -128,7 +128,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -59,7 +59,7 @@ func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) {
func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
sw := generator.NewSnippetWriter(w, c, "$", "$")
const pkgTestingCore = "k8s.io/kubernetes/pkg/client/testing/core"
const pkgTestingCore = "k8s.io/client-go/testing"
const pkgRESTClient = "k8s.io/client-go/rest"
m := map[string]interface{}{
"group": g.group,

View File

@ -87,7 +87,7 @@ func hasObjectMeta(t *types.Type) bool {
func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
sw := generator.NewSnippetWriter(w, c, "$", "$")
pkg := filepath.Base(t.Name.Package)
const pkgTestingCore = "k8s.io/kubernetes/pkg/client/testing/core"
const pkgTestingCore = "k8s.io/client-go/testing"
namespaced := !extractBoolTagOrDie("nonNamespaced", t.SecondClosestCommentLines)
canonicalGroup := g.group
if canonicalGroup == "core" {

View File

@ -19,11 +19,11 @@ go_library(
"//cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion:go_default_library",
"//cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion/fake:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,11 +21,11 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset"
internalversiontestgroup "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion"
fakeinternalversiontestgroup "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion/fake"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -33,17 +33,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -52,7 +52,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//cmd/libs/go2idl/client-gen/test_apis/testgroup:go_default_library",
"//cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/test_internalclientset/typed/testgroup/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeTestgroup struct {
*core.Fake
*testing.Fake
}
func (c *FakeTestgroup) TestTypes(namespace string) internalversion.TestTypeInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
testgroup "k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeTestTypes implements TestTypeInterface
@ -36,7 +36,7 @@ var testtypesResource = schema.GroupVersionResource{Group: "testgroup.k8s.io", V
func (c *FakeTestTypes) Create(testType *testgroup.TestType) (result *testgroup.TestType, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(testtypesResource, c.ns, testType), &testgroup.TestType{})
Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &testgroup.TestType{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeTestTypes) Create(testType *testgroup.TestType) (result *testgroup.
func (c *FakeTestTypes) Update(testType *testgroup.TestType) (result *testgroup.TestType, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(testtypesResource, c.ns, testType), &testgroup.TestType{})
Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &testgroup.TestType{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeTestTypes) Update(testType *testgroup.TestType) (result *testgroup.
func (c *FakeTestTypes) UpdateStatus(testType *testgroup.TestType) (*testgroup.TestType, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &testgroup.TestType{})
Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &testgroup.TestType{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeTestTypes) UpdateStatus(testType *testgroup.TestType) (*testgroup.T
func (c *FakeTestTypes) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(testtypesResource, c.ns, name), &testgroup.TestType{})
Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &testgroup.TestType{})
return err
}
func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &testgroup.TestTypeList{})
return err
@ -80,7 +80,7 @@ func (c *FakeTestTypes) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *testgroup.TestType, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(testtypesResource, c.ns, name), &testgroup.TestType{})
Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &testgroup.TestType{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeTestTypes) Get(name string, options v1.GetOptions) (result *testgro
func (c *FakeTestTypes) List(opts v1.ListOptions) (result *testgroup.TestTypeList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(testtypesResource, c.ns, opts), &testgroup.TestTypeList{})
Invokes(testing.NewListAction(testtypesResource, c.ns, opts), &testgroup.TestTypeList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeTestTypes) List(opts v1.ListOptions) (result *testgroup.TestTypeLis
// Watch returns a watch.Interface that watches the requested testTypes.
func (c *FakeTestTypes) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(testtypesResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched testType.
func (c *FakeTestTypes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *testgroup.TestType, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &testgroup.TestType{})
Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, data, subresources...), &testgroup.TestType{})
if obj == nil {
return nil, err

View File

@ -27,11 +27,11 @@ go_library(
"//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1:go_default_library",
"//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset"
v1autoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1"
fakev1autoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake"
@ -33,7 +34,6 @@ import (
v1beta1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1"
fakev1beta1federation "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -41,17 +41,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -60,7 +60,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library",
"//pkg/apis/autoscaling/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAutoscalingV1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
@ -36,7 +36,7 @@ var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autos
func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.Horizo
func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.Horizo
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
return err
}
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{})
return err
@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *meta_v1.DeleteO
func (c *FakeHorizontalPodAutoscalers) Get(name string, options meta_v1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string, options meta_v1.GetOptio
func (c *FakeHorizontalPodAutoscalers) List(opts meta_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeHorizontalPodAutoscalers) List(opts meta_v1.ListOptions) (result *v
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *FakeHorizontalPodAutoscalers) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
}
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library",
"//pkg/apis/batch/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeBatchV1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/apis/batch/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeJobs implements JobInterface
@ -36,7 +36,7 @@ var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Re
func (c *FakeJobs) Create(job *v1.Job) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeJobs) Create(job *v1.Job) (result *v1.Job, err error) {
func (c *FakeJobs) Update(job *v1.Job) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeJobs) Update(job *v1.Job) (result *v1.Job, err error) {
func (c *FakeJobs) UpdateStatus(job *v1.Job) (*v1.Job, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeJobs) UpdateStatus(job *v1.Job) (*v1.Job, error) {
func (c *FakeJobs) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(jobsResource, c.ns, name), &v1.Job{})
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &v1.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.JobList{})
return err
@ -80,7 +80,7 @@ func (c *FakeJobs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions
func (c *FakeJobs) Get(name string, options meta_v1.GetOptions) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(jobsResource, c.ns, name), &v1.Job{})
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1.Job{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeJobs) Get(name string, options meta_v1.GetOptions) (result *v1.Job,
func (c *FakeJobs) List(opts meta_v1.ListOptions) (result *v1.JobList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(jobsResource, c.ns, opts), &v1.JobList{})
Invokes(testing.NewListAction(jobsResource, c.ns, opts), &v1.JobList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeJobs) List(opts meta_v1.ListOptions) (result *v1.JobList, err error
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(jobsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1.Job{})
if obj == nil {
return nil, err

View File

@ -23,13 +23,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/api/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeConfigMaps implements ConfigMapInterface
@ -36,7 +36,7 @@ var configmapsResource = schema.GroupVersionResource{Group: "", Version: "v1", R
func (c *FakeConfigMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{})
Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeConfigMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap,
func (c *FakeConfigMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{})
Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeConfigMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap,
func (c *FakeConfigMaps) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(configmapsResource, c.ns, name), &v1.ConfigMap{})
Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &v1.ConfigMap{})
return err
}
func (c *FakeConfigMaps) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ConfigMapList{})
return err
@ -70,7 +70,7 @@ func (c *FakeConfigMaps) DeleteCollection(options *meta_v1.DeleteOptions, listOp
func (c *FakeConfigMaps) Get(name string, options meta_v1.GetOptions) (result *v1.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(configmapsResource, c.ns, name), &v1.ConfigMap{})
Invokes(testing.NewGetAction(configmapsResource, c.ns, name), &v1.ConfigMap{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeConfigMaps) Get(name string, options meta_v1.GetOptions) (result *v
func (c *FakeConfigMaps) List(opts meta_v1.ListOptions) (result *v1.ConfigMapList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(configmapsResource, c.ns, opts), &v1.ConfigMapList{})
Invokes(testing.NewListAction(configmapsResource, c.ns, opts), &v1.ConfigMapList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeConfigMaps) List(opts meta_v1.ListOptions) (result *v1.ConfigMapLis
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *FakeConfigMaps) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(configmapsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched configMap.
func (c *FakeConfigMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &v1.ConfigMap{})
Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &v1.ConfigMap{})
if obj == nil {
return nil, err

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeCoreV1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeCoreV1) ConfigMaps(namespace string) v1.ConfigMapInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/api/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeEvents implements EventInterface
@ -36,7 +36,7 @@ var eventsResource = schema.GroupVersionResource{Group: "", Version: "v1", Resou
func (c *FakeEvents) Create(event *v1.Event) (result *v1.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(eventsResource, c.ns, event), &v1.Event{})
Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1.Event{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeEvents) Create(event *v1.Event) (result *v1.Event, err error) {
func (c *FakeEvents) Update(event *v1.Event) (result *v1.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(eventsResource, c.ns, event), &v1.Event{})
Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &v1.Event{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeEvents) Update(event *v1.Event) (result *v1.Event, err error) {
func (c *FakeEvents) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(eventsResource, c.ns, name), &v1.Event{})
Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &v1.Event{})
return err
}
func (c *FakeEvents) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.EventList{})
return err
@ -70,7 +70,7 @@ func (c *FakeEvents) DeleteCollection(options *meta_v1.DeleteOptions, listOption
func (c *FakeEvents) Get(name string, options meta_v1.GetOptions) (result *v1.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(eventsResource, c.ns, name), &v1.Event{})
Invokes(testing.NewGetAction(eventsResource, c.ns, name), &v1.Event{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeEvents) Get(name string, options meta_v1.GetOptions) (result *v1.Ev
func (c *FakeEvents) List(opts meta_v1.ListOptions) (result *v1.EventList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(eventsResource, c.ns, opts), &v1.EventList{})
Invokes(testing.NewListAction(eventsResource, c.ns, opts), &v1.EventList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeEvents) List(opts meta_v1.ListOptions) (result *v1.EventList, err e
// Watch returns a watch.Interface that watches the requested events.
func (c *FakeEvents) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(eventsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched event.
func (c *FakeEvents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &v1.Event{})
Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &v1.Event{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/api/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeNamespaces implements NamespaceInterface
@ -35,7 +35,7 @@ var namespacesResource = schema.GroupVersionResource{Group: "", Version: "v1", R
func (c *FakeNamespaces) Create(namespace *v1.Namespace) (result *v1.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(namespacesResource, namespace), &v1.Namespace{})
Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &v1.Namespace{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeNamespaces) Create(namespace *v1.Namespace) (result *v1.Namespace,
func (c *FakeNamespaces) Update(namespace *v1.Namespace) (result *v1.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(namespacesResource, namespace), &v1.Namespace{})
Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), &v1.Namespace{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeNamespaces) Update(namespace *v1.Namespace) (result *v1.Namespace,
func (c *FakeNamespaces) UpdateStatus(namespace *v1.Namespace) (*v1.Namespace, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &v1.Namespace{})
Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &v1.Namespace{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeNamespaces) UpdateStatus(namespace *v1.Namespace) (*v1.Namespace, e
func (c *FakeNamespaces) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(namespacesResource, name), &v1.Namespace{})
Invokes(testing.NewRootDeleteAction(namespacesResource, name), &v1.Namespace{})
return err
}
func (c *FakeNamespaces) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(namespacesResource, listOptions)
action := testing.NewRootDeleteCollectionAction(namespacesResource, listOptions)
_, err := c.Fake.Invokes(action, &v1.NamespaceList{})
return err
@ -75,7 +75,7 @@ func (c *FakeNamespaces) DeleteCollection(options *meta_v1.DeleteOptions, listOp
func (c *FakeNamespaces) Get(name string, options meta_v1.GetOptions) (result *v1.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(namespacesResource, name), &v1.Namespace{})
Invokes(testing.NewRootGetAction(namespacesResource, name), &v1.Namespace{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeNamespaces) Get(name string, options meta_v1.GetOptions) (result *v
func (c *FakeNamespaces) List(opts meta_v1.ListOptions) (result *v1.NamespaceList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(namespacesResource, opts), &v1.NamespaceList{})
Invokes(testing.NewRootListAction(namespacesResource, opts), &v1.NamespaceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeNamespaces) List(opts meta_v1.ListOptions) (result *v1.NamespaceLis
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *FakeNamespaces) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(namespacesResource, opts))
InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts))
}
// Patch applies the patch and returns the patched namespace.
func (c *FakeNamespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &v1.Namespace{})
Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &v1.Namespace{})
if obj == nil {
return nil, err
}

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeNamespaces) Finalize(namespace *v1.Namespace) (*v1.Namespace, error) {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/api/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeSecrets implements SecretInterface
@ -36,7 +36,7 @@ var secretsResource = schema.GroupVersionResource{Group: "", Version: "v1", Reso
func (c *FakeSecrets) Create(secret *v1.Secret) (result *v1.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(secretsResource, c.ns, secret), &v1.Secret{})
Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), &v1.Secret{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeSecrets) Create(secret *v1.Secret) (result *v1.Secret, err error) {
func (c *FakeSecrets) Update(secret *v1.Secret) (result *v1.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(secretsResource, c.ns, secret), &v1.Secret{})
Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), &v1.Secret{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeSecrets) Update(secret *v1.Secret) (result *v1.Secret, err error) {
func (c *FakeSecrets) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(secretsResource, c.ns, name), &v1.Secret{})
Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &v1.Secret{})
return err
}
func (c *FakeSecrets) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.SecretList{})
return err
@ -70,7 +70,7 @@ func (c *FakeSecrets) DeleteCollection(options *meta_v1.DeleteOptions, listOptio
func (c *FakeSecrets) Get(name string, options meta_v1.GetOptions) (result *v1.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(secretsResource, c.ns, name), &v1.Secret{})
Invokes(testing.NewGetAction(secretsResource, c.ns, name), &v1.Secret{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeSecrets) Get(name string, options meta_v1.GetOptions) (result *v1.S
func (c *FakeSecrets) List(opts meta_v1.ListOptions) (result *v1.SecretList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(secretsResource, c.ns, opts), &v1.SecretList{})
Invokes(testing.NewListAction(secretsResource, c.ns, opts), &v1.SecretList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeSecrets) List(opts meta_v1.ListOptions) (result *v1.SecretList, err
// Watch returns a watch.Interface that watches the requested secrets.
func (c *FakeSecrets) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(secretsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched secret.
func (c *FakeSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &v1.Secret{})
Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &v1.Secret{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/api/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeServices implements ServiceInterface
@ -36,7 +36,7 @@ var servicesResource = schema.GroupVersionResource{Group: "", Version: "v1", Res
func (c *FakeServices) Create(service *v1.Service) (result *v1.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(servicesResource, c.ns, service), &v1.Service{})
Invokes(testing.NewCreateAction(servicesResource, c.ns, service), &v1.Service{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeServices) Create(service *v1.Service) (result *v1.Service, err erro
func (c *FakeServices) Update(service *v1.Service) (result *v1.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(servicesResource, c.ns, service), &v1.Service{})
Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), &v1.Service{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeServices) Update(service *v1.Service) (result *v1.Service, err erro
func (c *FakeServices) UpdateStatus(service *v1.Service) (*v1.Service, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &v1.Service{})
Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &v1.Service{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeServices) UpdateStatus(service *v1.Service) (*v1.Service, error) {
func (c *FakeServices) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(servicesResource, c.ns, name), &v1.Service{})
Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &v1.Service{})
return err
}
func (c *FakeServices) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ServiceList{})
return err
@ -80,7 +80,7 @@ func (c *FakeServices) DeleteCollection(options *meta_v1.DeleteOptions, listOpti
func (c *FakeServices) Get(name string, options meta_v1.GetOptions) (result *v1.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(servicesResource, c.ns, name), &v1.Service{})
Invokes(testing.NewGetAction(servicesResource, c.ns, name), &v1.Service{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeServices) Get(name string, options meta_v1.GetOptions) (result *v1.
func (c *FakeServices) List(opts meta_v1.ListOptions) (result *v1.ServiceList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(servicesResource, c.ns, opts), &v1.ServiceList{})
Invokes(testing.NewListAction(servicesResource, c.ns, opts), &v1.ServiceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeServices) List(opts meta_v1.ListOptions) (result *v1.ServiceList, e
// Watch returns a watch.Interface that watches the requested services.
func (c *FakeServices) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(servicesResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(servicesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched service.
func (c *FakeServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &v1.Service{})
Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &v1.Service{})
if obj == nil {
return nil, err

View File

@ -22,13 +22,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeDaemonSets implements DaemonSetInterface
@ -36,7 +36,7 @@ var daemonsetsResource = schema.GroupVersionResource{Group: "extensions", Versio
func (c *FakeDaemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{})
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeDaemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.D
func (c *FakeDaemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{})
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeDaemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.D
func (c *FakeDaemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta1.DaemonSet{})
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta1.DaemonSet{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeDaemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (*v1beta1.Da
func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{})
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{})
return err
}
func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.DaemonSetList{})
return err
@ -80,7 +80,7 @@ func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{})
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *v1beta
func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(daemonsetsResource, c.ns, opts), &v1beta1.DaemonSetList{})
Invokes(testing.NewListAction(daemonsetsResource, c.ns, opts), &v1beta1.DaemonSetList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetLis
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(daemonsetsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched daemonSet.
func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &v1beta1.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &v1beta1.DaemonSet{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeDeployments implements DeploymentInterface
@ -36,7 +36,7 @@ var deploymentsResource = schema.GroupVersionResource{Group: "extensions", Versi
func (c *FakeDeployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeDeployments) Create(deployment *v1beta1.Deployment) (result *v1beta
func (c *FakeDeployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeDeployments) Update(deployment *v1beta1.Deployment) (result *v1beta
func (c *FakeDeployments) UpdateStatus(deployment *v1beta1.Deployment) (*v1beta1.Deployment, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{})
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeDeployments) UpdateStatus(deployment *v1beta1.Deployment) (*v1beta1
func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
return err
}
func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{})
return err
@ -80,7 +80,7 @@ func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *v1bet
func (c *FakeDeployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(deploymentsResource, c.ns, opts), &v1beta1.DeploymentList{})
Invokes(testing.NewListAction(deploymentsResource, c.ns, opts), &v1beta1.DeploymentList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeDeployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentL
// Watch returns a watch.Interface that watches the requested deployments.
func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(deploymentsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &v1beta1.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &v1beta1.Deployment{})
if obj == nil {
return nil, err

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeDeployments) Rollback(deploymentRollback *v1beta1.DeploymentRollback) error {

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeExtensionsV1beta1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeExtensionsV1beta1) DaemonSets(namespace string) v1beta1.DaemonSetInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeIngresses implements IngressInterface
@ -36,7 +36,7 @@ var ingressesResource = schema.GroupVersionResource{Group: "extensions", Version
func (c *FakeIngresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{})
Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeIngresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingres
func (c *FakeIngresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{})
Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeIngresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingres
func (c *FakeIngresses) UpdateStatus(ingress *v1beta1.Ingress) (*v1beta1.Ingress, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1beta1.Ingress{})
Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1beta1.Ingress{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeIngresses) UpdateStatus(ingress *v1beta1.Ingress) (*v1beta1.Ingress
func (c *FakeIngresses) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{})
Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &v1beta1.Ingress{})
return err
}
func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.IngressList{})
return err
@ -80,7 +80,7 @@ func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(ingressesResource, c.ns, name), &v1beta1.Ingress{})
Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &v1beta1.Ingress{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *v1beta1
func (c *FakeIngresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(ingressesResource, c.ns, opts), &v1beta1.IngressList{})
Invokes(testing.NewListAction(ingressesResource, c.ns, opts), &v1beta1.IngressList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeIngresses) List(opts v1.ListOptions) (result *v1beta1.IngressList,
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *FakeIngresses) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(ingressesResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched ingress.
func (c *FakeIngresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &v1beta1.Ingress{})
Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &v1beta1.Ingress{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeReplicaSets implements ReplicaSetInterface
@ -36,7 +36,7 @@ var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Versi
func (c *FakeReplicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeReplicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta
func (c *FakeReplicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeReplicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta
func (c *FakeReplicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta1.ReplicaSet{})
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta1.ReplicaSet{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeReplicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (*v1beta1
func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
return err
}
func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{})
return err
@ -80,7 +80,7 @@ func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *v1bet
func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(replicasetsResource, c.ns, opts), &v1beta1.ReplicaSetList{})
Invokes(testing.NewListAction(replicasetsResource, c.ns, opts), &v1beta1.ReplicaSetList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetL
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(replicasetsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched replicaSet.
func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &v1beta1.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &v1beta1.ReplicaSet{})
if obj == nil {
return nil, err

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/apis/federation/v1beta1:go_default_library",
"//federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeClusters implements ClusterInterface
@ -35,7 +35,7 @@ var clustersResource = schema.GroupVersionResource{Group: "federation", Version:
func (c *FakeClusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(clustersResource, cluster), &v1beta1.Cluster{})
Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v1beta1.Cluster{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeClusters) Create(cluster *v1beta1.Cluster) (result *v1beta1.Cluster
func (c *FakeClusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(clustersResource, cluster), &v1beta1.Cluster{})
Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v1beta1.Cluster{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeClusters) Update(cluster *v1beta1.Cluster) (result *v1beta1.Cluster
func (c *FakeClusters) UpdateStatus(cluster *v1beta1.Cluster) (*v1beta1.Cluster, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1beta1.Cluster{})
Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v1beta1.Cluster{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeClusters) UpdateStatus(cluster *v1beta1.Cluster) (*v1beta1.Cluster,
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(clustersResource, name), &v1beta1.Cluster{})
Invokes(testing.NewRootDeleteAction(clustersResource, name), &v1beta1.Cluster{})
return err
}
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(clustersResource, listOptions)
action := testing.NewRootDeleteCollectionAction(clustersResource, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.ClusterList{})
return err
@ -75,7 +75,7 @@ func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1beta1.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(clustersResource, name), &v1beta1.Cluster{})
Invokes(testing.NewRootGetAction(clustersResource, name), &v1beta1.Cluster{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *v1beta1.
func (c *FakeClusters) List(opts v1.ListOptions) (result *v1beta1.ClusterList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(clustersResource, opts), &v1beta1.ClusterList{})
Invokes(testing.NewRootListAction(clustersResource, opts), &v1beta1.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeClusters) List(opts v1.ListOptions) (result *v1beta1.ClusterList, e
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(clustersResource, opts))
InvokesWatch(testing.NewRootWatchAction(clustersResource, opts))
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &v1beta1.Cluster{})
Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &v1beta1.Cluster{})
if obj == nil {
return nil, err
}

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeFederationV1beta1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeFederationV1beta1) Clusters() v1beta1.ClusterInterface {

View File

@ -27,11 +27,11 @@ go_library(
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion:go_default_library",
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset"
internalversionautoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion"
fakeinternalversionautoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake"
@ -33,7 +34,6 @@ import (
internalversionfederation "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion"
fakeinternalversionfederation "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -41,17 +41,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -60,7 +60,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion:go_default_library",
"//pkg/apis/autoscaling:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAutoscaling struct {
*core.Fake
*testing.Fake
}
func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) internalversion.HorizontalPodAutoscalerInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
@ -36,7 +36,7 @@ var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autos
func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscali
func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscali
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *aut
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
return err
}
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &autoscaling.HorizontalPodAutoscalerList{})
return err
@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOption
func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (
func (c *FakeHorizontalPodAutoscalers) List(opts v1.ListOptions) (result *autoscaling.HorizontalPodAutoscalerList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &autoscaling.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &autoscaling.HorizontalPodAutoscalerList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeHorizontalPodAutoscalers) List(opts v1.ListOptions) (result *autosc
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *FakeHorizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
}
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *autoscaling.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &autoscaling.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &autoscaling.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeBatch struct {
*core.Fake
*testing.Fake
}
func (c *FakeBatch) Jobs(namespace string) internalversion.JobInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
batch "k8s.io/kubernetes/pkg/apis/batch"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeJobs implements JobInterface
@ -36,7 +36,7 @@ var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "", Reso
func (c *FakeJobs) Create(job *batch.Job) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(jobsResource, c.ns, job), &batch.Job{})
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeJobs) Create(job *batch.Job) (result *batch.Job, err error) {
func (c *FakeJobs) Update(job *batch.Job) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(jobsResource, c.ns, job), &batch.Job{})
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeJobs) Update(job *batch.Job) (result *batch.Job, err error) {
func (c *FakeJobs) UpdateStatus(job *batch.Job) (*batch.Job, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batch.Job{})
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &batch.Job{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeJobs) UpdateStatus(job *batch.Job) (*batch.Job, error) {
func (c *FakeJobs) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(jobsResource, c.ns, name), &batch.Job{})
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &batch.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &batch.JobList{})
return err
@ -80,7 +80,7 @@ func (c *FakeJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li
func (c *FakeJobs) Get(name string, options v1.GetOptions) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(jobsResource, c.ns, name), &batch.Job{})
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &batch.Job{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeJobs) Get(name string, options v1.GetOptions) (result *batch.Job, e
func (c *FakeJobs) List(opts v1.ListOptions) (result *batch.JobList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(jobsResource, c.ns, opts), &batch.JobList{})
Invokes(testing.NewListAction(jobsResource, c.ns, opts), &batch.JobList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeJobs) List(opts v1.ListOptions) (result *batch.JobList, err error)
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(jobsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *batch.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &batch.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &batch.Job{})
if obj == nil {
return nil, err

View File

@ -23,13 +23,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library",
"//pkg/api:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeConfigMaps implements ConfigMapInterface
@ -36,7 +36,7 @@ var configmapsResource = schema.GroupVersionResource{Group: "", Version: "", Res
func (c *FakeConfigMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeConfigMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap
func (c *FakeConfigMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeConfigMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap
func (c *FakeConfigMaps) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(configmapsResource, c.ns, name), &api.ConfigMap{})
Invokes(testing.NewDeleteAction(configmapsResource, c.ns, name), &api.ConfigMap{})
return err
}
func (c *FakeConfigMaps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.ConfigMapList{})
return err
@ -70,7 +70,7 @@ func (c *FakeConfigMaps) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeConfigMaps) Get(name string, options v1.GetOptions) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(configmapsResource, c.ns, name), &api.ConfigMap{})
Invokes(testing.NewGetAction(configmapsResource, c.ns, name), &api.ConfigMap{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeConfigMaps) Get(name string, options v1.GetOptions) (result *api.Co
func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *api.ConfigMapList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(configmapsResource, c.ns, opts), &api.ConfigMapList{})
Invokes(testing.NewListAction(configmapsResource, c.ns, opts), &api.ConfigMapList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeConfigMaps) List(opts v1.ListOptions) (result *api.ConfigMapList, e
// Watch returns a watch.Interface that watches the requested configMaps.
func (c *FakeConfigMaps) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(configmapsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched configMap.
func (c *FakeConfigMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.ConfigMap, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &api.ConfigMap{})
Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &api.ConfigMap{})
if obj == nil {
return nil, err

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeCore struct {
*core.Fake
*testing.Fake
}
func (c *FakeCore) ConfigMaps(namespace string) internalversion.ConfigMapInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeEvents implements EventInterface
@ -36,7 +36,7 @@ var eventsResource = schema.GroupVersionResource{Group: "", Version: "", Resourc
func (c *FakeEvents) Create(event *api.Event) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(eventsResource, c.ns, event), &api.Event{})
Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &api.Event{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeEvents) Create(event *api.Event) (result *api.Event, err error) {
func (c *FakeEvents) Update(event *api.Event) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(eventsResource, c.ns, event), &api.Event{})
Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &api.Event{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeEvents) Update(event *api.Event) (result *api.Event, err error) {
func (c *FakeEvents) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(eventsResource, c.ns, name), &api.Event{})
Invokes(testing.NewDeleteAction(eventsResource, c.ns, name), &api.Event{})
return err
}
func (c *FakeEvents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.EventList{})
return err
@ -70,7 +70,7 @@ func (c *FakeEvents) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
func (c *FakeEvents) Get(name string, options v1.GetOptions) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(eventsResource, c.ns, name), &api.Event{})
Invokes(testing.NewGetAction(eventsResource, c.ns, name), &api.Event{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeEvents) Get(name string, options v1.GetOptions) (result *api.Event,
func (c *FakeEvents) List(opts v1.ListOptions) (result *api.EventList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(eventsResource, c.ns, opts), &api.EventList{})
Invokes(testing.NewListAction(eventsResource, c.ns, opts), &api.EventList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeEvents) List(opts v1.ListOptions) (result *api.EventList, err error
// Watch returns a watch.Interface that watches the requested events.
func (c *FakeEvents) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(eventsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched event.
func (c *FakeEvents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Event, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &api.Event{})
Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &api.Event{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeNamespaces implements NamespaceInterface
@ -35,7 +35,7 @@ var namespacesResource = schema.GroupVersionResource{Group: "", Version: "", Res
func (c *FakeNamespaces) Create(namespace *api.Namespace) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(namespacesResource, namespace), &api.Namespace{})
Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeNamespaces) Create(namespace *api.Namespace) (result *api.Namespace
func (c *FakeNamespaces) Update(namespace *api.Namespace) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(namespacesResource, namespace), &api.Namespace{})
Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeNamespaces) Update(namespace *api.Namespace) (result *api.Namespace
func (c *FakeNamespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &api.Namespace{})
Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &api.Namespace{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeNamespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace,
func (c *FakeNamespaces) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(namespacesResource, name), &api.Namespace{})
Invokes(testing.NewRootDeleteAction(namespacesResource, name), &api.Namespace{})
return err
}
func (c *FakeNamespaces) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(namespacesResource, listOptions)
action := testing.NewRootDeleteCollectionAction(namespacesResource, listOptions)
_, err := c.Fake.Invokes(action, &api.NamespaceList{})
return err
@ -75,7 +75,7 @@ func (c *FakeNamespaces) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeNamespaces) Get(name string, options v1.GetOptions) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(namespacesResource, name), &api.Namespace{})
Invokes(testing.NewRootGetAction(namespacesResource, name), &api.Namespace{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeNamespaces) Get(name string, options v1.GetOptions) (result *api.Na
func (c *FakeNamespaces) List(opts v1.ListOptions) (result *api.NamespaceList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(namespacesResource, opts), &api.NamespaceList{})
Invokes(testing.NewRootListAction(namespacesResource, opts), &api.NamespaceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeNamespaces) List(opts v1.ListOptions) (result *api.NamespaceList, e
// Watch returns a watch.Interface that watches the requested namespaces.
func (c *FakeNamespaces) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(namespacesResource, opts))
InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts))
}
// Patch applies the patch and returns the patched namespace.
func (c *FakeNamespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Namespace, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &api.Namespace{})
Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &api.Namespace{})
if obj == nil {
return nil, err
}

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error) {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeSecrets implements SecretInterface
@ -36,7 +36,7 @@ var secretsResource = schema.GroupVersionResource{Group: "", Version: "", Resour
func (c *FakeSecrets) Create(secret *api.Secret) (result *api.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(secretsResource, c.ns, secret), &api.Secret{})
Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), &api.Secret{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeSecrets) Create(secret *api.Secret) (result *api.Secret, err error)
func (c *FakeSecrets) Update(secret *api.Secret) (result *api.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(secretsResource, c.ns, secret), &api.Secret{})
Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), &api.Secret{})
if obj == nil {
return nil, err
@ -56,13 +56,13 @@ func (c *FakeSecrets) Update(secret *api.Secret) (result *api.Secret, err error)
func (c *FakeSecrets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(secretsResource, c.ns, name), &api.Secret{})
Invokes(testing.NewDeleteAction(secretsResource, c.ns, name), &api.Secret{})
return err
}
func (c *FakeSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.SecretList{})
return err
@ -70,7 +70,7 @@ func (c *FakeSecrets) DeleteCollection(options *v1.DeleteOptions, listOptions v1
func (c *FakeSecrets) Get(name string, options v1.GetOptions) (result *api.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(secretsResource, c.ns, name), &api.Secret{})
Invokes(testing.NewGetAction(secretsResource, c.ns, name), &api.Secret{})
if obj == nil {
return nil, err
@ -80,13 +80,13 @@ func (c *FakeSecrets) Get(name string, options v1.GetOptions) (result *api.Secre
func (c *FakeSecrets) List(opts v1.ListOptions) (result *api.SecretList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(secretsResource, c.ns, opts), &api.SecretList{})
Invokes(testing.NewListAction(secretsResource, c.ns, opts), &api.SecretList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -102,14 +102,14 @@ func (c *FakeSecrets) List(opts v1.ListOptions) (result *api.SecretList, err err
// Watch returns a watch.Interface that watches the requested secrets.
func (c *FakeSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(secretsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched secret.
func (c *FakeSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Secret, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &api.Secret{})
Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &api.Secret{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
api "k8s.io/kubernetes/pkg/api"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeServices implements ServiceInterface
@ -36,7 +36,7 @@ var servicesResource = schema.GroupVersionResource{Group: "", Version: "", Resou
func (c *FakeServices) Create(service *api.Service) (result *api.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(servicesResource, c.ns, service), &api.Service{})
Invokes(testing.NewCreateAction(servicesResource, c.ns, service), &api.Service{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeServices) Create(service *api.Service) (result *api.Service, err er
func (c *FakeServices) Update(service *api.Service) (result *api.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(servicesResource, c.ns, service), &api.Service{})
Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), &api.Service{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeServices) Update(service *api.Service) (result *api.Service, err er
func (c *FakeServices) UpdateStatus(service *api.Service) (*api.Service, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &api.Service{})
Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &api.Service{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeServices) UpdateStatus(service *api.Service) (*api.Service, error)
func (c *FakeServices) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(servicesResource, c.ns, name), &api.Service{})
Invokes(testing.NewDeleteAction(servicesResource, c.ns, name), &api.Service{})
return err
}
func (c *FakeServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &api.ServiceList{})
return err
@ -80,7 +80,7 @@ func (c *FakeServices) DeleteCollection(options *v1.DeleteOptions, listOptions v
func (c *FakeServices) Get(name string, options v1.GetOptions) (result *api.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(servicesResource, c.ns, name), &api.Service{})
Invokes(testing.NewGetAction(servicesResource, c.ns, name), &api.Service{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeServices) Get(name string, options v1.GetOptions) (result *api.Serv
func (c *FakeServices) List(opts v1.ListOptions) (result *api.ServiceList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(servicesResource, c.ns, opts), &api.ServiceList{})
Invokes(testing.NewListAction(servicesResource, c.ns, opts), &api.ServiceList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeServices) List(opts v1.ListOptions) (result *api.ServiceList, err e
// Watch returns a watch.Interface that watches the requested services.
func (c *FakeServices) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(servicesResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(servicesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched service.
func (c *FakeServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Service, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &api.Service{})
Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &api.Service{})
if obj == nil {
return nil, err

View File

@ -21,13 +21,13 @@ go_library(
deps = [
"//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:go_default_library",
"//pkg/apis/extensions:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeDaemonSets implements DaemonSetInterface
@ -36,7 +36,7 @@ var daemonsetsResource = schema.GroupVersionResource{Group: "extensions", Versio
func (c *FakeDaemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeDaemonSets) Create(daemonSet *extensions.DaemonSet) (result *extens
func (c *FakeDaemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeDaemonSets) Update(daemonSet *extensions.DaemonSet) (result *extens
func (c *FakeDaemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (*extensions.DaemonSet, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &extensions.DaemonSet{})
Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &extensions.DaemonSet{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeDaemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (*extensi
func (c *FakeDaemonSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
Invokes(testing.NewDeleteAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
return err
}
func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.DaemonSetList{})
return err
@ -80,7 +80,7 @@ func (c *FakeDaemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *extensions.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeDaemonSets) Get(name string, options v1.GetOptions) (result *extens
func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSetList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(daemonsetsResource, c.ns, opts), &extensions.DaemonSetList{})
Invokes(testing.NewListAction(daemonsetsResource, c.ns, opts), &extensions.DaemonSetList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeDaemonSets) List(opts v1.ListOptions) (result *extensions.DaemonSet
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(daemonsetsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched daemonSet.
func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &extensions.DaemonSet{})
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &extensions.DaemonSet{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeDeployments implements DeploymentInterface
@ -36,7 +36,7 @@ var deploymentsResource = schema.GroupVersionResource{Group: "extensions", Versi
func (c *FakeDeployments) Create(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeDeployments) Create(deployment *extensions.Deployment) (result *ext
func (c *FakeDeployments) Update(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeDeployments) Update(deployment *extensions.Deployment) (result *ext
func (c *FakeDeployments) UpdateStatus(deployment *extensions.Deployment) (*extensions.Deployment, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &extensions.Deployment{})
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &extensions.Deployment{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeDeployments) UpdateStatus(deployment *extensions.Deployment) (*exte
func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
return err
}
func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.DeploymentList{})
return err
@ -80,7 +80,7 @@ func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *extensions.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *exten
func (c *FakeDeployments) List(opts v1.ListOptions) (result *extensions.DeploymentList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(deploymentsResource, c.ns, opts), &extensions.DeploymentList{})
Invokes(testing.NewListAction(deploymentsResource, c.ns, opts), &extensions.DeploymentList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeDeployments) List(opts v1.ListOptions) (result *extensions.Deployme
// Watch returns a watch.Interface that watches the requested deployments.
func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(deploymentsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &extensions.Deployment{})
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &extensions.Deployment{})
if obj == nil {
return nil, err

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeExtensions struct {
*core.Fake
*testing.Fake
}
func (c *FakeExtensions) DaemonSets(namespace string) internalversion.DaemonSetInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeIngresses implements IngressInterface
@ -36,7 +36,7 @@ var ingressesResource = schema.GroupVersionResource{Group: "extensions", Version
func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.
func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.
func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &extensions.Ingress{})
Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.I
func (c *FakeIngresses) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(ingressesResource, c.ns, name), &extensions.Ingress{})
Invokes(testing.NewDeleteAction(ingressesResource, c.ns, name), &extensions.Ingress{})
return err
}
func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.IngressList{})
return err
@ -80,7 +80,7 @@ func (c *FakeIngresses) DeleteCollection(options *v1.DeleteOptions, listOptions
func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(ingressesResource, c.ns, name), &extensions.Ingress{})
Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &extensions.Ingress{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeIngresses) Get(name string, options v1.GetOptions) (result *extensi
func (c *FakeIngresses) List(opts v1.ListOptions) (result *extensions.IngressList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(ingressesResource, c.ns, opts), &extensions.IngressList{})
Invokes(testing.NewListAction(ingressesResource, c.ns, opts), &extensions.IngressList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeIngresses) List(opts v1.ListOptions) (result *extensions.IngressLis
// Watch returns a watch.Interface that watches the requested ingresses.
func (c *FakeIngresses) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(ingressesResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts))
}
// Patch applies the patch and returns the patched ingress.
func (c *FakeIngresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.Ingress, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &extensions.Ingress{})
Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &extensions.Ingress{})
if obj == nil {
return nil, err

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
extensions "k8s.io/kubernetes/pkg/apis/extensions"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeReplicaSets implements ReplicaSetInterface
@ -36,7 +36,7 @@ var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Versi
func (c *FakeReplicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeReplicaSets) Create(replicaSet *extensions.ReplicaSet) (result *ext
func (c *FakeReplicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeReplicaSets) Update(replicaSet *extensions.ReplicaSet) (result *ext
func (c *FakeReplicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &extensions.ReplicaSet{})
Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &extensions.ReplicaSet{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeReplicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (*exte
func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
return err
}
func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &extensions.ReplicaSetList{})
return err
@ -80,7 +80,7 @@ func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOption
func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *extensions.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *exten
func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaSetList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(replicasetsResource, c.ns, opts), &extensions.ReplicaSetList{})
Invokes(testing.NewListAction(replicasetsResource, c.ns, opts), &extensions.ReplicaSetList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *extensions.ReplicaS
// Watch returns a watch.Interface that watches the requested replicaSets.
func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(replicasetsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched replicaSet.
func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &extensions.ReplicaSet{})
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &extensions.ReplicaSet{})
if obj == nil {
return nil, err

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//federation/apis/federation:go_default_library",
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
federation "k8s.io/kubernetes/federation/apis/federation"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeClusters implements ClusterInterface
@ -35,7 +35,7 @@ var clustersResource = schema.GroupVersionResource{Group: "federation", Version:
func (c *FakeClusters) Create(cluster *federation.Cluster) (result *federation.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootCreateAction(clustersResource, cluster), &federation.Cluster{})
Invokes(testing.NewRootCreateAction(clustersResource, cluster), &federation.Cluster{})
if obj == nil {
return nil, err
}
@ -44,7 +44,7 @@ func (c *FakeClusters) Create(cluster *federation.Cluster) (result *federation.C
func (c *FakeClusters) Update(cluster *federation.Cluster) (result *federation.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateAction(clustersResource, cluster), &federation.Cluster{})
Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &federation.Cluster{})
if obj == nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *FakeClusters) Update(cluster *federation.Cluster) (result *federation.C
func (c *FakeClusters) UpdateStatus(cluster *federation.Cluster) (*federation.Cluster, error) {
obj, err := c.Fake.
Invokes(core.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &federation.Cluster{})
Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &federation.Cluster{})
if obj == nil {
return nil, err
}
@ -62,12 +62,12 @@ func (c *FakeClusters) UpdateStatus(cluster *federation.Cluster) (*federation.Cl
func (c *FakeClusters) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewRootDeleteAction(clustersResource, name), &federation.Cluster{})
Invokes(testing.NewRootDeleteAction(clustersResource, name), &federation.Cluster{})
return err
}
func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewRootDeleteCollectionAction(clustersResource, listOptions)
action := testing.NewRootDeleteCollectionAction(clustersResource, listOptions)
_, err := c.Fake.Invokes(action, &federation.ClusterList{})
return err
@ -75,7 +75,7 @@ func (c *FakeClusters) DeleteCollection(options *v1.DeleteOptions, listOptions v
func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *federation.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootGetAction(clustersResource, name), &federation.Cluster{})
Invokes(testing.NewRootGetAction(clustersResource, name), &federation.Cluster{})
if obj == nil {
return nil, err
}
@ -84,12 +84,12 @@ func (c *FakeClusters) Get(name string, options v1.GetOptions) (result *federati
func (c *FakeClusters) List(opts v1.ListOptions) (result *federation.ClusterList, err error) {
obj, err := c.Fake.
Invokes(core.NewRootListAction(clustersResource, opts), &federation.ClusterList{})
Invokes(testing.NewRootListAction(clustersResource, opts), &federation.ClusterList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -105,13 +105,13 @@ func (c *FakeClusters) List(opts v1.ListOptions) (result *federation.ClusterList
// Watch returns a watch.Interface that watches the requested clusters.
func (c *FakeClusters) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewRootWatchAction(clustersResource, opts))
InvokesWatch(testing.NewRootWatchAction(clustersResource, opts))
}
// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *federation.Cluster, err error) {
obj, err := c.Fake.
Invokes(core.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &federation.Cluster{})
Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &federation.Cluster{})
if obj == nil {
return nil, err
}

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeFederation struct {
*core.Fake
*testing.Fake
}
func (c *FakeFederation) Clusters() internalversion.ClusterInterface {

View File

@ -48,11 +48,11 @@ go_test(
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -24,6 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
core "k8s.io/client-go/testing"
federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake"
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
@ -33,7 +34,6 @@ import (
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
fakekubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/stretchr/testify/assert"
)

View File

@ -53,11 +53,11 @@ go_test(
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/api/meta",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -25,6 +25,7 @@ import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/watch"
core "k8s.io/client-go/testing"
fedv1 "k8s.io/kubernetes/federation/apis/federation/v1beta1"
fedclientfake "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake"
"k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
@ -32,7 +33,6 @@ import (
extensionsv1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
kubeclientfake "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/stretchr/testify/assert"
)

View File

@ -65,12 +65,12 @@ go_test(
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/fake:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//pkg/controller/deployment/util:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/testing",
"//vendor:k8s.io/client-go/tools/cache",
],
)

View File

@ -29,10 +29,10 @@ go_test(
"//federation/client/clientset_generated/federation_clientset/fake:go_default_library",
"//federation/pkg/federation-controller/util/test:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/stretchr/testify/assert",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,10 +21,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
core "k8s.io/client-go/testing"
fakefedclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake"
. "k8s.io/kubernetes/federation/pkg/federation-controller/util/test"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/stretchr/testify/assert"
)

View File

@ -23,13 +23,13 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
core "k8s.io/client-go/testing"
"k8s.io/client-go/tools/cache"
federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
fakefederationclientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/fake"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
kubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
fakekubeclientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/stretchr/testify/assert"
)

View File

@ -16,12 +16,12 @@ go_library(
"//federation/pkg/federation-controller/util:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -28,11 +28,11 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/watch"
core "k8s.io/client-go/testing"
federationapi "k8s.io/kubernetes/federation/apis/federation/v1beta1"
"k8s.io/kubernetes/federation/pkg/federation-controller/util"
"k8s.io/kubernetes/pkg/api"
apiv1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/golang/glog"
)

View File

@ -145,8 +145,6 @@ pkg/client/listers/storage/internalversion
pkg/client/listers/storage/v1beta1
pkg/client/metrics
pkg/client/metrics/prometheus
pkg/client/testing/core
pkg/client/typed/discovery
pkg/client/unversioned
pkg/client/unversioned/remotecommand
pkg/cloudprovider/providers
@ -296,7 +294,6 @@ staging/src/k8s.io/client-go/plugin/pkg/client/auth
staging/src/k8s.io/client-go/plugin/pkg/client/auth/gcp
staging/src/k8s.io/client-go/rest/watch
staging/src/k8s.io/client-go/tools/auth
staging/src/k8s.io/client-go/tools/cache
staging/src/k8s.io/client-go/tools/metrics
staging/src/k8s.io/client-go/util/cert
staging/src/k8s.io/client-go/util/homedir

View File

@ -70,8 +70,6 @@ filegroup(
"//pkg/client/record:all-srcs",
"//pkg/client/retry:all-srcs",
"//pkg/client/testdata:all-srcs",
"//pkg/client/testing/cache:all-srcs",
"//pkg/client/testing/core:all-srcs",
"//pkg/client/tests:all-srcs",
"//pkg/client/unversioned:all-srcs",
"//pkg/cloudprovider:all-srcs",

View File

@ -43,11 +43,11 @@ go_library(
"//pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/storage/v1beta1/fake:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/discovery",
"//vendor:k8s.io/client-go/discovery/fake",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -21,6 +21,7 @@ import (
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing"
"k8s.io/kubernetes/pkg/api"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
v1beta1apps "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1"
@ -49,7 +50,6 @@ import (
fakev1beta1rbac "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/rbac/v1beta1/fake"
v1beta1storage "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1"
fakev1beta1storage "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/storage/v1beta1/fake"
"k8s.io/kubernetes/pkg/client/testing/core"
)
// NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -57,17 +57,17 @@ import (
// without applying any validations and/or defaults. It shouldn't be considered a replacement
// for a real clientset and is mostly useful in simple unit tests.
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
o := testing.NewObjectTracker(api.Registry, api.Scheme, api.Codecs.UniversalDecoder())
for _, obj := range objects {
if err := o.Add(obj); err != nil {
panic(err)
}
}
fakePtr := core.Fake{}
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr := testing.Fake{}
fakePtr.AddReactor("*", "*", testing.ObjectReaction(o, api.Registry.RESTMapper()))
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil))
return &Clientset{fakePtr}
}
@ -76,7 +76,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset {
// struct to get a default implementation. This makes faking out just the method
// you want to test easier.
type Clientset struct {
core.Fake
testing.Fake
}
func (c *Clientset) Discovery() discovery.DiscoveryInterface {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/apps/v1beta1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAppsV1beta1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/apis/apps/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeStatefulSets implements StatefulSetInterface
@ -36,7 +36,7 @@ var statefulsetsResource = schema.GroupVersionResource{Group: "apps", Version: "
func (c *FakeStatefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeStatefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1b
func (c *FakeStatefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeStatefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1b
func (c *FakeStatefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{})
Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeStatefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (*v1be
func (c *FakeStatefulSets) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
Invokes(testing.NewDeleteAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
return err
}
func (c *FakeStatefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := core.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{})
return err
@ -80,7 +80,7 @@ func (c *FakeStatefulSets) DeleteCollection(options *v1.DeleteOptions, listOptio
func (c *FakeStatefulSets) Get(name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeStatefulSets) Get(name string, options v1.GetOptions) (result *v1be
func (c *FakeStatefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(statefulsetsResource, c.ns, opts), &v1beta1.StatefulSetList{})
Invokes(testing.NewListAction(statefulsetsResource, c.ns, opts), &v1beta1.StatefulSetList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeStatefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSe
// Watch returns a watch.Interface that watches the requested statefulSets.
func (c *FakeStatefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(statefulsetsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched statefulSet.
func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, data, subresources...), &v1beta1.StatefulSet{})
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, data, subresources...), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err

View File

@ -19,8 +19,8 @@ go_library(
deps = [
"//pkg/apis/authentication/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/authentication/v1beta1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authentication/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAuthenticationV1beta1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface {

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
authenticationapi "k8s.io/kubernetes/pkg/apis/authentication/v1beta1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeTokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {

View File

@ -24,8 +24,8 @@ go_library(
deps = [
"//pkg/apis/authorization/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/authorization/v1beta1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authorization/v1beta1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAuthorizationV1beta1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeAuthorizationV1beta1) LocalSubjectAccessReviews(namespace string) v1beta1.LocalSubjectAccessReviewInterface {

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
authorizationapi "k8s.io/kubernetes/pkg/apis/authorization/v1beta1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeLocalSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) {

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
authorizationapi "k8s.io/kubernetes/pkg/apis/authorization/v1beta1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeSelfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) {

View File

@ -17,8 +17,8 @@ limitations under the License.
package fake
import (
core "k8s.io/client-go/testing"
authorizationapi "k8s.io/kubernetes/pkg/apis/authorization/v1beta1"
"k8s.io/kubernetes/pkg/client/testing/core"
)
func (c *FakeSubjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//pkg/apis/autoscaling/v1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/autoscaling/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/autoscaling/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeAutoscalingV1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface
@ -36,7 +36,7 @@ var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autos
func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.Horizo
func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.Horizo
func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.
func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
return err
}
func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{})
return err
@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *meta_v1.DeleteO
func (c *FakeHorizontalPodAutoscalers) Get(name string, options meta_v1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeHorizontalPodAutoscalers) Get(name string, options meta_v1.GetOptio
func (c *FakeHorizontalPodAutoscalers) List(opts meta_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
Invokes(testing.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeHorizontalPodAutoscalers) List(opts meta_v1.ListOptions) (result *v
// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers.
func (c *FakeHorizontalPodAutoscalers) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts))
}
// Patch applies the patch and returns the patched horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{})
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err

View File

@ -18,13 +18,13 @@ go_library(
deps = [
"//pkg/apis/batch/v1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/batch/v1:go_default_library",
"//pkg/client/testing/core:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apimachinery/pkg/types",
"//vendor:k8s.io/apimachinery/pkg/watch",
"//vendor:k8s.io/client-go/rest",
"//vendor:k8s.io/client-go/testing",
],
)

View File

@ -18,12 +18,12 @@ package fake
import (
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/batch/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
type FakeBatchV1 struct {
*core.Fake
*testing.Fake
}
func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface {

View File

@ -22,8 +22,8 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1 "k8s.io/kubernetes/pkg/apis/batch/v1"
core "k8s.io/kubernetes/pkg/client/testing/core"
)
// FakeJobs implements JobInterface
@ -36,7 +36,7 @@ var jobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Re
func (c *FakeJobs) Create(job *v1.Job) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewCreateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -46,7 +46,7 @@ func (c *FakeJobs) Create(job *v1.Job) (result *v1.Job, err error) {
func (c *FakeJobs) Update(job *v1.Job) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -56,7 +56,7 @@ func (c *FakeJobs) Update(job *v1.Job) (result *v1.Job, err error) {
func (c *FakeJobs) UpdateStatus(job *v1.Job) (*v1.Job, error) {
obj, err := c.Fake.
Invokes(core.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{})
Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{})
if obj == nil {
return nil, err
@ -66,13 +66,13 @@ func (c *FakeJobs) UpdateStatus(job *v1.Job) (*v1.Job, error) {
func (c *FakeJobs) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(core.NewDeleteAction(jobsResource, c.ns, name), &v1.Job{})
Invokes(testing.NewDeleteAction(jobsResource, c.ns, name), &v1.Job{})
return err
}
func (c *FakeJobs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := core.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.JobList{})
return err
@ -80,7 +80,7 @@ func (c *FakeJobs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions
func (c *FakeJobs) Get(name string, options meta_v1.GetOptions) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewGetAction(jobsResource, c.ns, name), &v1.Job{})
Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1.Job{})
if obj == nil {
return nil, err
@ -90,13 +90,13 @@ func (c *FakeJobs) Get(name string, options meta_v1.GetOptions) (result *v1.Job,
func (c *FakeJobs) List(opts meta_v1.ListOptions) (result *v1.JobList, err error) {
obj, err := c.Fake.
Invokes(core.NewListAction(jobsResource, c.ns, opts), &v1.JobList{})
Invokes(testing.NewListAction(jobsResource, c.ns, opts), &v1.JobList{})
if obj == nil {
return nil, err
}
label, _, _ := core.ExtractFromListOptions(opts)
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
@ -112,14 +112,14 @@ func (c *FakeJobs) List(opts meta_v1.ListOptions) (result *v1.JobList, err error
// Watch returns a watch.Interface that watches the requested jobs.
func (c *FakeJobs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(core.NewWatchAction(jobsResource, c.ns, opts))
InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched job.
func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) {
obj, err := c.Fake.
Invokes(core.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1.Job{})
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1.Job{})
if obj == nil {
return nil, err

Some files were not shown because too many files have changed in this diff Show More