mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-03 08:04:45 +00:00
generated: update clients
Kubernetes-commit: 9443a3814446ecca4905f7ac7059c67f120151b9
This commit is contained in:
committed by
Kubernetes Publisher
parent
60a0346672
commit
3e02731f97
@@ -19,6 +19,8 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
@@ -38,7 +40,7 @@ var priorityclassesResource = schema.GroupVersionResource{Group: "scheduling.k8s
|
||||
var priorityclassesKind = schema.GroupVersionKind{Group: "scheduling.k8s.io", Version: "v1", Kind: "PriorityClass"}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *schedulingv1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *schedulingv1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(priorityclassesResource, name), &schedulingv1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -48,7 +50,7 @@ func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *s
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *schedulingv1.PriorityClassList, err error) {
|
||||
func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *schedulingv1.PriorityClassList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &schedulingv1.PriorityClassList{})
|
||||
if obj == nil {
|
||||
@@ -69,13 +71,13 @@ func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *schedulingv1.Pr
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *FakePriorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Create(priorityClass *schedulingv1.PriorityClass) (result *schedulingv1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *schedulingv1.PriorityClass) (result *schedulingv1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &schedulingv1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -85,7 +87,7 @@ func (c *FakePriorityClasses) Create(priorityClass *schedulingv1.PriorityClass)
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Update(priorityClass *schedulingv1.PriorityClass) (result *schedulingv1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *schedulingv1.PriorityClass) (result *schedulingv1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &schedulingv1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -95,14 +97,14 @@ func (c *FakePriorityClasses) Update(priorityClass *schedulingv1.PriorityClass)
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePriorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &schedulingv1.PriorityClass{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &schedulingv1.PriorityClassList{})
|
||||
@@ -110,7 +112,7 @@ func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOp
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *FakePriorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *schedulingv1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *schedulingv1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &schedulingv1.PriorityClass{})
|
||||
if obj == nil {
|
||||
|
@@ -38,14 +38,14 @@ type PriorityClassesGetter interface {
|
||||
|
||||
// PriorityClassInterface has methods to work with PriorityClass resources.
|
||||
type PriorityClassInterface interface {
|
||||
Create(*v1.PriorityClass) (*v1.PriorityClass, error)
|
||||
Update(*v1.PriorityClass) (*v1.PriorityClass, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(name string, options metav1.GetOptions) (*v1.PriorityClass, error)
|
||||
List(opts metav1.ListOptions) (*v1.PriorityClassList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error)
|
||||
Create(context.Context, *v1.PriorityClass) (*v1.PriorityClass, error)
|
||||
Update(context.Context, *v1.PriorityClass) (*v1.PriorityClass, error)
|
||||
Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, options metav1.GetOptions) (*v1.PriorityClass, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error)
|
||||
PriorityClassExpansion
|
||||
}
|
||||
|
||||
@@ -62,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1Client) *priorityClasses {
|
||||
}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *priorityClasses) Get(name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) {
|
||||
result = &v1.PriorityClass{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *priorityClasses) List(opts metav1.ListOptions) (result *v1.PriorityClassList, err error) {
|
||||
func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
@@ -84,13 +84,13 @@ func (c *priorityClasses) List(opts metav1.ListOptions) (result *v1.PriorityClas
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *priorityClasses) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
func (c *priorityClasses) 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
|
||||
@@ -100,44 +100,44 @@ func (c *priorityClasses) Watch(opts metav1.ListOptions) (watch.Interface, error
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(context.TODO())
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Create(priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) {
|
||||
result = &v1.PriorityClass{}
|
||||
err = c.client.Post().
|
||||
Resource("priorityclasses").
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Update(priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) {
|
||||
result = &v1.PriorityClass{}
|
||||
err = c.client.Put().
|
||||
Resource("priorityclasses").
|
||||
Name(priorityClass.Name).
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityClasses) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
func (c *priorityClasses) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityClasses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
func (c *priorityClasses) DeleteCollection(ctx context.Context, options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOptions.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||
@@ -147,19 +147,19 @@ func (c *priorityClasses) DeleteCollection(options *metav1.DeleteOptions, listOp
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error) {
|
||||
result = &v1.PriorityClass{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("priorityclasses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
@@ -38,7 +40,7 @@ var priorityclassesResource = schema.GroupVersionResource{Group: "scheduling.k8s
|
||||
var priorityclassesKind = schema.GroupVersionKind{Group: "scheduling.k8s.io", Version: "v1alpha1", Kind: "PriorityClass"}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -48,7 +50,7 @@ func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *v
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1alpha1.PriorityClassList{})
|
||||
if obj == nil {
|
||||
@@ -69,13 +71,13 @@ func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *v1alpha1.Priori
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *FakePriorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -85,7 +87,7 @@ func (c *FakePriorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (res
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -95,14 +97,14 @@ func (c *FakePriorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (res
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePriorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &v1alpha1.PriorityClass{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{})
|
||||
@@ -110,7 +112,7 @@ func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOp
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *FakePriorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &v1alpha1.PriorityClass{})
|
||||
if obj == nil {
|
||||
|
@@ -38,14 +38,14 @@ type PriorityClassesGetter interface {
|
||||
|
||||
// PriorityClassInterface has methods to work with PriorityClass resources.
|
||||
type PriorityClassInterface interface {
|
||||
Create(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Update(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*v1alpha1.PriorityClass, error)
|
||||
List(opts v1.ListOptions) (*v1alpha1.PriorityClassList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error)
|
||||
Create(context.Context, *v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Update(context.Context, *v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error)
|
||||
Delete(ctx context.Context, name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, options v1.GetOptions) (*v1alpha1.PriorityClass, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error)
|
||||
PriorityClassExpansion
|
||||
}
|
||||
|
||||
@@ -62,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1alpha1Client) *priorityClasses {
|
||||
}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
@@ -84,13 +84,13 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityCl
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
@@ -100,44 +100,44 @@ func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(context.TODO())
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Post().
|
||||
Resource("priorityclasses").
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Put().
|
||||
Resource("priorityclasses").
|
||||
Name(priorityClass.Name).
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
func (c *priorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
func (c *priorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOptions.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||
@@ -147,19 +147,19 @@ func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOption
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) {
|
||||
result = &v1alpha1.PriorityClass{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("priorityclasses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
v1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
@@ -38,7 +40,7 @@ var priorityclassesResource = schema.GroupVersionResource{Group: "scheduling.k8s
|
||||
var priorityclassesKind = schema.GroupVersionKind{Group: "scheduling.k8s.io", Version: "v1beta1", Kind: "PriorityClass"}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1beta1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -48,7 +50,7 @@ func (c *FakePriorityClasses) Get(name string, options v1.GetOptions) (result *v
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) {
|
||||
func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1beta1.PriorityClassList{})
|
||||
if obj == nil {
|
||||
@@ -69,13 +71,13 @@ func (c *FakePriorityClasses) List(opts v1.ListOptions) (result *v1beta1.Priorit
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *FakePriorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Create(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1beta1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -85,7 +87,7 @@ func (c *FakePriorityClasses) Create(priorityClass *v1beta1.PriorityClass) (resu
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *FakePriorityClasses) Update(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1beta1.PriorityClass{})
|
||||
if obj == nil {
|
||||
@@ -95,14 +97,14 @@ func (c *FakePriorityClasses) Update(priorityClass *v1beta1.PriorityClass) (resu
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePriorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
func (c *FakePriorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(priorityclassesResource, name), &v1beta1.PriorityClass{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.PriorityClassList{})
|
||||
@@ -110,7 +112,7 @@ func (c *FakePriorityClasses) DeleteCollection(options *v1.DeleteOptions, listOp
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *FakePriorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &v1beta1.PriorityClass{})
|
||||
if obj == nil {
|
||||
|
@@ -38,14 +38,14 @@ type PriorityClassesGetter interface {
|
||||
|
||||
// PriorityClassInterface has methods to work with PriorityClass resources.
|
||||
type PriorityClassInterface interface {
|
||||
Create(*v1beta1.PriorityClass) (*v1beta1.PriorityClass, error)
|
||||
Update(*v1beta1.PriorityClass) (*v1beta1.PriorityClass, error)
|
||||
Delete(name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(name string, options v1.GetOptions) (*v1beta1.PriorityClass, error)
|
||||
List(opts v1.ListOptions) (*v1beta1.PriorityClassList, error)
|
||||
Watch(opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error)
|
||||
Create(context.Context, *v1beta1.PriorityClass) (*v1beta1.PriorityClass, error)
|
||||
Update(context.Context, *v1beta1.PriorityClass) (*v1beta1.PriorityClass, error)
|
||||
Delete(ctx context.Context, name string, options *v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, options v1.GetOptions) (*v1beta1.PriorityClass, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error)
|
||||
PriorityClassExpansion
|
||||
}
|
||||
|
||||
@@ -62,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1beta1Client) *priorityClasses {
|
||||
}
|
||||
|
||||
// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any.
|
||||
func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) {
|
||||
result = &v1beta1.PriorityClass{}
|
||||
err = c.client.Get().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors.
|
||||
func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) {
|
||||
func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
@@ -84,13 +84,13 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityCla
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested priorityClasses.
|
||||
func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
@@ -100,44 +100,44 @@ func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||
Resource("priorityclasses").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(context.TODO())
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Create(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
result = &v1beta1.PriorityClass{}
|
||||
err = c.client.Post().
|
||||
Resource("priorityclasses").
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any.
|
||||
func (c *priorityClasses) Update(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) {
|
||||
result = &v1beta1.PriorityClass{}
|
||||
err = c.client.Put().
|
||||
Resource("priorityclasses").
|
||||
Name(priorityClass.Name).
|
||||
Body(priorityClass).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs.
|
||||
func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error {
|
||||
func (c *priorityClasses) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("priorityclasses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
func (c *priorityClasses) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOptions.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||
@@ -147,19 +147,19 @@ func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOption
|
||||
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(options).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched priorityClass.
|
||||
func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) {
|
||||
func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) {
|
||||
result = &v1beta1.PriorityClass{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("priorityclasses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do(context.TODO()).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user