From 8cbcbcd044414ec3ce36b15f509bf8d3ad536641 Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Fri, 16 Aug 2024 21:38:43 +0300 Subject: [PATCH] go generate Signed-off-by: galal-hussein --- .../versioned/fake/clientset_generated.go | 6 +- .../versioned/typed/k3s.cattle.io/v1/addon.go | 129 ++--------------- .../k3s.cattle.io/v1/etcdsnapshotfile.go | 135 ++---------------- .../typed/k3s.cattle.io/v1/fake/fake_addon.go | 29 ++-- .../v1/fake/fake_etcdsnapshotfile.go | 36 +++-- 5 files changed, 62 insertions(+), 273 deletions(-) diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 270adfe162..f910d553e8 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -31,8 +31,12 @@ import ( // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { diff --git a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/addon.go b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/addon.go index 6f1bf5871a..7eaa80a9f6 100644 --- a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/addon.go +++ b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/addon.go @@ -20,14 +20,13 @@ package v1 import ( "context" - "time" v1 "github.com/k3s-io/k3s/pkg/apis/k3s.cattle.io/v1" scheme "github.com/k3s-io/k3s/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // AddonsGetter has a method to return a AddonInterface. @@ -51,128 +50,18 @@ type AddonInterface interface { // addons implements AddonInterface type addons struct { - client rest.Interface - ns string + *gentype.ClientWithList[*v1.Addon, *v1.AddonList] } // newAddons returns a Addons func newAddons(c *K3sV1Client, namespace string) *addons { return &addons{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*v1.Addon, *v1.AddonList]( + "addons", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Addon { return &v1.Addon{} }, + func() *v1.AddonList { return &v1.AddonList{} }), } } - -// Get takes name of the addon, and returns the corresponding addon object, and an error if there is any. -func (c *addons) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Addon, err error) { - result = &v1.Addon{} - err = c.client.Get(). - Namespace(c.ns). - Resource("addons"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Addons that match those selectors. -func (c *addons) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AddonList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.AddonList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("addons"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested addons. -func (c *addons) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("addons"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a addon and creates it. Returns the server's representation of the addon, and an error, if there is any. -func (c *addons) Create(ctx context.Context, addon *v1.Addon, opts metav1.CreateOptions) (result *v1.Addon, err error) { - result = &v1.Addon{} - err = c.client.Post(). - Namespace(c.ns). - Resource("addons"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(addon). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a addon and updates it. Returns the server's representation of the addon, and an error, if there is any. -func (c *addons) Update(ctx context.Context, addon *v1.Addon, opts metav1.UpdateOptions) (result *v1.Addon, err error) { - result = &v1.Addon{} - err = c.client.Put(). - Namespace(c.ns). - Resource("addons"). - Name(addon.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(addon). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the addon and deletes it. Returns an error if one occurs. -func (c *addons) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("addons"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *addons) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("addons"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched addon. -func (c *addons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Addon, err error) { - result = &v1.Addon{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("addons"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/etcdsnapshotfile.go b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/etcdsnapshotfile.go index 148cd2af83..4e515e9d2c 100644 --- a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/etcdsnapshotfile.go +++ b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/etcdsnapshotfile.go @@ -20,14 +20,13 @@ package v1 import ( "context" - "time" v1 "github.com/k3s-io/k3s/pkg/apis/k3s.cattle.io/v1" scheme "github.com/k3s-io/k3s/pkg/generated/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // ETCDSnapshotFilesGetter has a method to return a ETCDSnapshotFileInterface. @@ -40,6 +39,7 @@ type ETCDSnapshotFilesGetter interface { type ETCDSnapshotFileInterface interface { Create(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.CreateOptions) (*v1.ETCDSnapshotFile, error) Update(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (*v1.ETCDSnapshotFile, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (*v1.ETCDSnapshotFile, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -52,133 +52,18 @@ type ETCDSnapshotFileInterface interface { // eTCDSnapshotFiles implements ETCDSnapshotFileInterface type eTCDSnapshotFiles struct { - client rest.Interface + *gentype.ClientWithList[*v1.ETCDSnapshotFile, *v1.ETCDSnapshotFileList] } // newETCDSnapshotFiles returns a ETCDSnapshotFiles func newETCDSnapshotFiles(c *K3sV1Client) *eTCDSnapshotFiles { return &eTCDSnapshotFiles{ - client: c.RESTClient(), + gentype.NewClientWithList[*v1.ETCDSnapshotFile, *v1.ETCDSnapshotFileList]( + "etcdsnapshotfiles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ETCDSnapshotFile { return &v1.ETCDSnapshotFile{} }, + func() *v1.ETCDSnapshotFileList { return &v1.ETCDSnapshotFileList{} }), } } - -// Get takes name of the eTCDSnapshotFile, and returns the corresponding eTCDSnapshotFile object, and an error if there is any. -func (c *eTCDSnapshotFiles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ETCDSnapshotFile, err error) { - result = &v1.ETCDSnapshotFile{} - err = c.client.Get(). - Resource("etcdsnapshotfiles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ETCDSnapshotFiles that match those selectors. -func (c *eTCDSnapshotFiles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ETCDSnapshotFileList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ETCDSnapshotFileList{} - err = c.client.Get(). - Resource("etcdsnapshotfiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested eTCDSnapshotFiles. -func (c *eTCDSnapshotFiles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("etcdsnapshotfiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a eTCDSnapshotFile and creates it. Returns the server's representation of the eTCDSnapshotFile, and an error, if there is any. -func (c *eTCDSnapshotFiles) Create(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.CreateOptions) (result *v1.ETCDSnapshotFile, err error) { - result = &v1.ETCDSnapshotFile{} - err = c.client.Post(). - Resource("etcdsnapshotfiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(eTCDSnapshotFile). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a eTCDSnapshotFile and updates it. Returns the server's representation of the eTCDSnapshotFile, and an error, if there is any. -func (c *eTCDSnapshotFiles) Update(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (result *v1.ETCDSnapshotFile, err error) { - result = &v1.ETCDSnapshotFile{} - err = c.client.Put(). - Resource("etcdsnapshotfiles"). - Name(eTCDSnapshotFile.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(eTCDSnapshotFile). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *eTCDSnapshotFiles) UpdateStatus(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (result *v1.ETCDSnapshotFile, err error) { - result = &v1.ETCDSnapshotFile{} - err = c.client.Put(). - Resource("etcdsnapshotfiles"). - Name(eTCDSnapshotFile.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(eTCDSnapshotFile). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the eTCDSnapshotFile and deletes it. Returns an error if one occurs. -func (c *eTCDSnapshotFiles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("etcdsnapshotfiles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *eTCDSnapshotFiles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("etcdsnapshotfiles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched eTCDSnapshotFile. -func (c *eTCDSnapshotFiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ETCDSnapshotFile, err error) { - result = &v1.ETCDSnapshotFile{} - err = c.client.Patch(pt). - Resource("etcdsnapshotfiles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_addon.go b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_addon.go index 4971362c34..f89aa1ef91 100644 --- a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_addon.go +++ b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_addon.go @@ -41,22 +41,24 @@ var addonsKind = v1.SchemeGroupVersion.WithKind("Addon") // Get takes name of the addon, and returns the corresponding addon object, and an error if there is any. func (c *FakeAddons) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Addon, err error) { + emptyResult := &v1.Addon{} obj, err := c.Fake. - Invokes(testing.NewGetAction(addonsResource, c.ns, name), &v1.Addon{}) + Invokes(testing.NewGetActionWithOptions(addonsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Addon), err } // List takes label and field selectors, and returns the list of Addons that match those selectors. func (c *FakeAddons) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AddonList, err error) { + emptyResult := &v1.AddonList{} obj, err := c.Fake. - Invokes(testing.NewListAction(addonsResource, addonsKind, c.ns, opts), &v1.AddonList{}) + Invokes(testing.NewListActionWithOptions(addonsResource, addonsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -75,28 +77,30 @@ func (c *FakeAddons) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested addons. func (c *FakeAddons) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(addonsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(addonsResource, c.ns, opts)) } // Create takes the representation of a addon and creates it. Returns the server's representation of the addon, and an error, if there is any. func (c *FakeAddons) Create(ctx context.Context, addon *v1.Addon, opts metav1.CreateOptions) (result *v1.Addon, err error) { + emptyResult := &v1.Addon{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(addonsResource, c.ns, addon), &v1.Addon{}) + Invokes(testing.NewCreateActionWithOptions(addonsResource, c.ns, addon, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Addon), err } // Update takes the representation of a addon and updates it. Returns the server's representation of the addon, and an error, if there is any. func (c *FakeAddons) Update(ctx context.Context, addon *v1.Addon, opts metav1.UpdateOptions) (result *v1.Addon, err error) { + emptyResult := &v1.Addon{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(addonsResource, c.ns, addon), &v1.Addon{}) + Invokes(testing.NewUpdateActionWithOptions(addonsResource, c.ns, addon, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Addon), err } @@ -111,7 +115,7 @@ func (c *FakeAddons) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeAddons) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(addonsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(addonsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.AddonList{}) return err @@ -119,11 +123,12 @@ func (c *FakeAddons) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched addon. func (c *FakeAddons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Addon, err error) { + emptyResult := &v1.Addon{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(addonsResource, c.ns, name, pt, data, subresources...), &v1.Addon{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(addonsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Addon), err } diff --git a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_etcdsnapshotfile.go b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_etcdsnapshotfile.go index b4ad567c34..b008003cc4 100644 --- a/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_etcdsnapshotfile.go +++ b/pkg/generated/clientset/versioned/typed/k3s.cattle.io/v1/fake/fake_etcdsnapshotfile.go @@ -40,20 +40,22 @@ var etcdsnapshotfilesKind = v1.SchemeGroupVersion.WithKind("ETCDSnapshotFile") // Get takes name of the eTCDSnapshotFile, and returns the corresponding eTCDSnapshotFile object, and an error if there is any. func (c *FakeETCDSnapshotFiles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ETCDSnapshotFile, err error) { + emptyResult := &v1.ETCDSnapshotFile{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(etcdsnapshotfilesResource, name), &v1.ETCDSnapshotFile{}) + Invokes(testing.NewRootGetActionWithOptions(etcdsnapshotfilesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ETCDSnapshotFile), err } // List takes label and field selectors, and returns the list of ETCDSnapshotFiles that match those selectors. func (c *FakeETCDSnapshotFiles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ETCDSnapshotFileList, err error) { + emptyResult := &v1.ETCDSnapshotFileList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(etcdsnapshotfilesResource, etcdsnapshotfilesKind, opts), &v1.ETCDSnapshotFileList{}) + Invokes(testing.NewRootListActionWithOptions(etcdsnapshotfilesResource, etcdsnapshotfilesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -72,36 +74,39 @@ func (c *FakeETCDSnapshotFiles) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested eTCDSnapshotFiles. func (c *FakeETCDSnapshotFiles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(etcdsnapshotfilesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(etcdsnapshotfilesResource, opts)) } // Create takes the representation of a eTCDSnapshotFile and creates it. Returns the server's representation of the eTCDSnapshotFile, and an error, if there is any. func (c *FakeETCDSnapshotFiles) Create(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.CreateOptions) (result *v1.ETCDSnapshotFile, err error) { + emptyResult := &v1.ETCDSnapshotFile{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(etcdsnapshotfilesResource, eTCDSnapshotFile), &v1.ETCDSnapshotFile{}) + Invokes(testing.NewRootCreateActionWithOptions(etcdsnapshotfilesResource, eTCDSnapshotFile, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ETCDSnapshotFile), err } // Update takes the representation of a eTCDSnapshotFile and updates it. Returns the server's representation of the eTCDSnapshotFile, and an error, if there is any. func (c *FakeETCDSnapshotFiles) Update(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (result *v1.ETCDSnapshotFile, err error) { + emptyResult := &v1.ETCDSnapshotFile{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(etcdsnapshotfilesResource, eTCDSnapshotFile), &v1.ETCDSnapshotFile{}) + Invokes(testing.NewRootUpdateActionWithOptions(etcdsnapshotfilesResource, eTCDSnapshotFile, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ETCDSnapshotFile), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeETCDSnapshotFiles) UpdateStatus(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (*v1.ETCDSnapshotFile, error) { +func (c *FakeETCDSnapshotFiles) UpdateStatus(ctx context.Context, eTCDSnapshotFile *v1.ETCDSnapshotFile, opts metav1.UpdateOptions) (result *v1.ETCDSnapshotFile, err error) { + emptyResult := &v1.ETCDSnapshotFile{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(etcdsnapshotfilesResource, "status", eTCDSnapshotFile), &v1.ETCDSnapshotFile{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(etcdsnapshotfilesResource, "status", eTCDSnapshotFile, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ETCDSnapshotFile), err } @@ -115,7 +120,7 @@ func (c *FakeETCDSnapshotFiles) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeETCDSnapshotFiles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(etcdsnapshotfilesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(etcdsnapshotfilesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ETCDSnapshotFileList{}) return err @@ -123,10 +128,11 @@ func (c *FakeETCDSnapshotFiles) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched eTCDSnapshotFile. func (c *FakeETCDSnapshotFiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ETCDSnapshotFile, err error) { + emptyResult := &v1.ETCDSnapshotFile{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(etcdsnapshotfilesResource, name, pt, data, subresources...), &v1.ETCDSnapshotFile{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(etcdsnapshotfilesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ETCDSnapshotFile), err }