mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-02-01 01:12:52 +08:00
update clients
Kubernetes-commit: 86bd06c8820a785cb8d74ef29d4a6a80c08988c0
This commit is contained in:
parent
a4d2d71ffa
commit
cba8e5b7f3
@ -115,7 +115,7 @@ func (c *FakeFoos) UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete takes name of the foo and deletes it. Returns an error if one occurs.
|
// Delete takes name of the foo and deletes it. Returns an error if one occurs.
|
||||||
func (c *FakeFoos) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
func (c *FakeFoos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||||
_, err := c.Fake.
|
_, err := c.Fake.
|
||||||
Invokes(testing.NewDeleteAction(foosResource, c.ns, name), &v1alpha1.Foo{})
|
Invokes(testing.NewDeleteAction(foosResource, c.ns, name), &v1alpha1.Foo{})
|
||||||
|
|
||||||
@ -123,8 +123,8 @@ func (c *FakeFoos) Delete(ctx context.Context, name string, options *v1.DeleteOp
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCollection deletes a collection of objects.
|
// DeleteCollection deletes a collection of objects.
|
||||||
func (c *FakeFoos) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
func (c *FakeFoos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||||
action := testing.NewDeleteCollectionAction(foosResource, c.ns, listOptions)
|
action := testing.NewDeleteCollectionAction(foosResource, c.ns, listOpts)
|
||||||
|
|
||||||
_, err := c.Fake.Invokes(action, &v1alpha1.FooList{})
|
_, err := c.Fake.Invokes(action, &v1alpha1.FooList{})
|
||||||
return err
|
return err
|
||||||
|
@ -41,8 +41,8 @@ type FooInterface interface {
|
|||||||
Create(ctx context.Context, foo *v1alpha1.Foo, opts v1.CreateOptions) (*v1alpha1.Foo, error)
|
Create(ctx context.Context, foo *v1alpha1.Foo, opts v1.CreateOptions) (*v1alpha1.Foo, error)
|
||||||
Update(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
Update(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
||||||
UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.UpdateOptions) (*v1alpha1.Foo, error)
|
||||||
Delete(ctx context.Context, name string, opts *v1.DeleteOptions) error
|
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||||
DeleteCollection(ctx context.Context, opts *v1.DeleteOptions, listOpts v1.ListOptions) error
|
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Foo, error)
|
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Foo, error)
|
||||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FooList, error)
|
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FooList, error)
|
||||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||||
@ -153,28 +153,28 @@ func (c *foos) UpdateStatus(ctx context.Context, foo *v1alpha1.Foo, opts v1.Upda
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete takes name of the foo and deletes it. Returns an error if one occurs.
|
// Delete takes name of the foo and deletes it. Returns an error if one occurs.
|
||||||
func (c *foos) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
func (c *foos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||||
return c.client.Delete().
|
return c.client.Delete().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("foos").
|
Resource("foos").
|
||||||
Name(name).
|
Name(name).
|
||||||
Body(options).
|
Body(&opts).
|
||||||
Do(ctx).
|
Do(ctx).
|
||||||
Error()
|
Error()
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCollection deletes a collection of objects.
|
// DeleteCollection deletes a collection of objects.
|
||||||
func (c *foos) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
func (c *foos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||||
var timeout time.Duration
|
var timeout time.Duration
|
||||||
if listOptions.TimeoutSeconds != nil {
|
if listOpts.TimeoutSeconds != nil {
|
||||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||||
}
|
}
|
||||||
return c.client.Delete().
|
return c.client.Delete().
|
||||||
Namespace(c.ns).
|
Namespace(c.ns).
|
||||||
Resource("foos").
|
Resource("foos").
|
||||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||||
Timeout(timeout).
|
Timeout(timeout).
|
||||||
Body(options).
|
Body(&opts).
|
||||||
Do(ctx).
|
Do(ctx).
|
||||||
Error()
|
Error()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user