Merge pull request #87299 from mikedanese/ctx

context in client-go
This commit is contained in:
Kubernetes Prow Robot
2020-02-08 06:43:52 -08:00
committed by GitHub
954 changed files with 8533 additions and 7714 deletions

View File

@@ -38,14 +38,14 @@ type ExamplesGetter interface {
// ExampleInterface has methods to work with Example resources.
type ExampleInterface interface {
Create(*v1.Example) (*v1.Example, error)
Update(*v1.Example) (*v1.Example, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.Example, error)
List(opts metav1.ListOptions) (*v1.ExampleList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Example, err error)
Create(context.Context, *v1.Example) (*v1.Example, error)
Update(context.Context, *v1.Example) (*v1.Example, 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.Example, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.ExampleList, 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.Example, err error)
ExampleExpansion
}
@@ -64,20 +64,20 @@ func newExamples(c *CrV1Client, namespace string) *examples {
}
// Get takes name of the example, and returns the corresponding example object, and an error if there is any.
func (c *examples) Get(name string, options metav1.GetOptions) (result *v1.Example, err error) {
func (c *examples) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Example, err error) {
result = &v1.Example{}
err = c.client.Get().
Namespace(c.ns).
Resource("examples").
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 Examples that match those selectors.
func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err error) {
func (c *examples) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExampleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -88,13 +88,13 @@ func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err er
Resource("examples").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested examples.
func (c *examples) Watch(opts metav1.ListOptions) (watch.Interface, error) {
func (c *examples) 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
@@ -105,47 +105,47 @@ func (c *examples) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("examples").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(context.TODO())
Watch(ctx)
}
// Create takes the representation of a example and creates it. Returns the server's representation of the example, and an error, if there is any.
func (c *examples) Create(example *v1.Example) (result *v1.Example, err error) {
func (c *examples) Create(ctx context.Context, example *v1.Example) (result *v1.Example, err error) {
result = &v1.Example{}
err = c.client.Post().
Namespace(c.ns).
Resource("examples").
Body(example).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a example and updates it. Returns the server's representation of the example, and an error, if there is any.
func (c *examples) Update(example *v1.Example) (result *v1.Example, err error) {
func (c *examples) Update(ctx context.Context, example *v1.Example) (result *v1.Example, err error) {
result = &v1.Example{}
err = c.client.Put().
Namespace(c.ns).
Resource("examples").
Name(example.Name).
Body(example).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Delete takes name of the example and deletes it. Returns an error if one occurs.
func (c *examples) Delete(name string, options *metav1.DeleteOptions) error {
func (c *examples) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("examples").
Name(name).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *examples) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *examples) 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
@@ -156,12 +156,12 @@ func (c *examples) DeleteCollection(options *metav1.DeleteOptions, listOptions m
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched example.
func (c *examples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Example, err error) {
func (c *examples) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Example, err error) {
result = &v1.Example{}
err = c.client.Patch(pt).
Namespace(c.ns).
@@ -169,7 +169,7 @@ func (c *examples) Patch(name string, pt types.PatchType, data []byte, subresour
SubResource(subresources...).
Name(name).
Body(data).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}

View File

@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
@@ -39,7 +41,7 @@ var examplesResource = schema.GroupVersionResource{Group: "cr.example.apiextensi
var examplesKind = schema.GroupVersionKind{Group: "cr.example.apiextensions.k8s.io", Version: "v1", Kind: "Example"}
// Get takes name of the example, and returns the corresponding example object, and an error if there is any.
func (c *FakeExamples) Get(name string, options v1.GetOptions) (result *crv1.Example, err error) {
func (c *FakeExamples) Get(ctx context.Context, name string, options v1.GetOptions) (result *crv1.Example, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(examplesResource, c.ns, name), &crv1.Example{})
@@ -50,7 +52,7 @@ func (c *FakeExamples) Get(name string, options v1.GetOptions) (result *crv1.Exa
}
// List takes label and field selectors, and returns the list of Examples that match those selectors.
func (c *FakeExamples) List(opts v1.ListOptions) (result *crv1.ExampleList, err error) {
func (c *FakeExamples) List(ctx context.Context, opts v1.ListOptions) (result *crv1.ExampleList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(examplesResource, examplesKind, c.ns, opts), &crv1.ExampleList{})
@@ -72,14 +74,14 @@ func (c *FakeExamples) List(opts v1.ListOptions) (result *crv1.ExampleList, err
}
// Watch returns a watch.Interface that watches the requested examples.
func (c *FakeExamples) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeExamples) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(examplesResource, c.ns, opts))
}
// Create takes the representation of a example and creates it. Returns the server's representation of the example, and an error, if there is any.
func (c *FakeExamples) Create(example *crv1.Example) (result *crv1.Example, err error) {
func (c *FakeExamples) Create(ctx context.Context, example *crv1.Example) (result *crv1.Example, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(examplesResource, c.ns, example), &crv1.Example{})
@@ -90,7 +92,7 @@ func (c *FakeExamples) Create(example *crv1.Example) (result *crv1.Example, err
}
// Update takes the representation of a example and updates it. Returns the server's representation of the example, and an error, if there is any.
func (c *FakeExamples) Update(example *crv1.Example) (result *crv1.Example, err error) {
func (c *FakeExamples) Update(ctx context.Context, example *crv1.Example) (result *crv1.Example, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(examplesResource, c.ns, example), &crv1.Example{})
@@ -101,7 +103,7 @@ func (c *FakeExamples) Update(example *crv1.Example) (result *crv1.Example, err
}
// Delete takes name of the example and deletes it. Returns an error if one occurs.
func (c *FakeExamples) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeExamples) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(examplesResource, c.ns, name), &crv1.Example{})
@@ -109,7 +111,7 @@ func (c *FakeExamples) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *FakeExamples) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeExamples) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(examplesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &crv1.ExampleList{})
@@ -117,7 +119,7 @@ func (c *FakeExamples) DeleteCollection(options *v1.DeleteOptions, listOptions v
}
// Patch applies the patch and returns the patched example.
func (c *FakeExamples) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *crv1.Example, err error) {
func (c *FakeExamples) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *crv1.Example, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(examplesResource, c.ns, name, pt, data, subresources...), &crv1.Example{})

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
crv1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1"
@@ -61,13 +62,13 @@ func NewFilteredExampleInformer(client versioned.Interface, namespace string, re
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrV1().Examples(namespace).List(options)
return client.CrV1().Examples(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrV1().Examples(namespace).Watch(options)
return client.CrV1().Examples(namespace).Watch(context.TODO(), options)
},
},
&crv1.Example{},

View File

@@ -38,15 +38,15 @@ type CustomResourceDefinitionsGetter interface {
// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources.
type CustomResourceDefinitionInterface interface {
Create(*v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, error)
Update(*v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, error)
UpdateStatus(*v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.CustomResourceDefinition, error)
List(opts metav1.ListOptions) (*v1.CustomResourceDefinitionList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CustomResourceDefinition, err error)
Create(context.Context, *v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, error)
Update(context.Context, *v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, error)
UpdateStatus(context.Context, *v1.CustomResourceDefinition) (*v1.CustomResourceDefinition, 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.CustomResourceDefinition, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.CustomResourceDefinitionList, 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.CustomResourceDefinition, err error)
CustomResourceDefinitionExpansion
}
@@ -63,19 +63,19 @@ func newCustomResourceDefinitions(c *ApiextensionsV1Client) *customResourceDefin
}
// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
func (c *customResourceDefinitions) Get(name string, options metav1.GetOptions) (result *v1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CustomResourceDefinition, err error) {
result = &v1.CustomResourceDefinition{}
err = c.client.Get().
Resource("customresourcedefinitions").
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 CustomResourceDefinitions that match those selectors.
func (c *customResourceDefinitions) List(opts metav1.ListOptions) (result *v1.CustomResourceDefinitionList, err error) {
func (c *customResourceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CustomResourceDefinitionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -85,13 +85,13 @@ func (c *customResourceDefinitions) List(opts metav1.ListOptions) (result *v1.Cu
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
func (c *customResourceDefinitions) Watch(opts metav1.ListOptions) (watch.Interface, error) {
func (c *customResourceDefinitions) 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
@@ -101,28 +101,28 @@ func (c *customResourceDefinitions) Watch(opts metav1.ListOptions) (watch.Interf
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(context.TODO())
Watch(ctx)
}
// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Create(customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
result = &v1.CustomResourceDefinition{}
err = c.client.Post().
Resource("customresourcedefinitions").
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Update(customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
result = &v1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
@@ -130,30 +130,30 @@ func (c *customResourceDefinitions) Update(customResourceDefinition *v1.CustomRe
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition) (result *v1.CustomResourceDefinition, err error) {
result = &v1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
SubResource("status").
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
func (c *customResourceDefinitions) Delete(name string, options *metav1.DeleteOptions) error {
func (c *customResourceDefinitions) Delete(ctx context.Context, name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Resource("customresourcedefinitions").
Name(name).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *customResourceDefinitions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
func (c *customResourceDefinitions) 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
@@ -163,19 +163,19 @@ func (c *customResourceDefinitions) DeleteCollection(options *metav1.DeleteOptio
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched customResourceDefinition.
func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CustomResourceDefinition, err error) {
result = &v1.CustomResourceDefinition{}
err = c.client.Patch(pt).
Resource("customresourcedefinitions").
SubResource(subresources...).
Name(name).
Body(data).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}

View File

@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
@@ -38,7 +40,7 @@ var customresourcedefinitionsResource = schema.GroupVersionResource{Group: "apie
var customresourcedefinitionsKind = schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1", Kind: "CustomResourceDefinition"}
// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions) (result *apiextensionsv1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *apiextensionsv1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(customresourcedefinitionsResource, name), &apiextensionsv1.CustomResourceDefinition{})
if obj == nil {
@@ -48,7 +50,7 @@ func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors.
func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *apiextensionsv1.CustomResourceDefinitionList, err error) {
func (c *FakeCustomResourceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *apiextensionsv1.CustomResourceDefinitionList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(customresourcedefinitionsResource, customresourcedefinitionsKind, opts), &apiextensionsv1.CustomResourceDefinitionList{})
if obj == nil {
@@ -69,13 +71,13 @@ func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *apiex
}
// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
func (c *FakeCustomResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeCustomResourceDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(customresourcedefinitionsResource, opts))
}
// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (result *apiextensionsv1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Create(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (result *apiextensionsv1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(customresourcedefinitionsResource, customResourceDefinition), &apiextensionsv1.CustomResourceDefinition{})
if obj == nil {
@@ -85,7 +87,7 @@ func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *apiexte
}
// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (result *apiextensionsv1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Update(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (result *apiextensionsv1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(customresourcedefinitionsResource, customResourceDefinition), &apiextensionsv1.CustomResourceDefinition{})
if obj == nil {
@@ -96,7 +98,7 @@ func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *apiexte
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (*apiextensionsv1.CustomResourceDefinition, error) {
func (c *FakeCustomResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinition) (*apiextensionsv1.CustomResourceDefinition, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(customresourcedefinitionsResource, "status", customResourceDefinition), &apiextensionsv1.CustomResourceDefinition{})
if obj == nil {
@@ -106,14 +108,14 @@ func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *a
}
// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
func (c *FakeCustomResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &apiextensionsv1.CustomResourceDefinition{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions)
_, err := c.Fake.Invokes(action, &apiextensionsv1.CustomResourceDefinitionList{})
@@ -121,7 +123,7 @@ func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptio
}
// Patch applies the patch and returns the patched customResourceDefinition.
func (c *FakeCustomResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apiextensionsv1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *apiextensionsv1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, name, pt, data, subresources...), &apiextensionsv1.CustomResourceDefinition{})
if obj == nil {

View File

@@ -38,15 +38,15 @@ type CustomResourceDefinitionsGetter interface {
// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources.
type CustomResourceDefinitionInterface interface {
Create(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Update(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
UpdateStatus(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1beta1.CustomResourceDefinition, error)
List(opts v1.ListOptions) (*v1beta1.CustomResourceDefinitionList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error)
Create(context.Context, *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Update(context.Context, *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
UpdateStatus(context.Context, *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, 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.CustomResourceDefinition, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CustomResourceDefinitionList, 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.CustomResourceDefinition, err error)
CustomResourceDefinitionExpansion
}
@@ -63,19 +63,19 @@ func newCustomResourceDefinitions(c *ApiextensionsV1beta1Client) *customResource
}
// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Get().
Resource("customresourcedefinitions").
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 CustomResourceDefinitions that match those selectors.
func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
func (c *customResourceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@@ -85,13 +85,13 @@ func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.C
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *customResourceDefinitions) 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
@@ -101,28 +101,28 @@ func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface,
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(context.TODO())
Watch(ctx)
}
// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Create(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Post().
Resource("customresourcedefinitions").
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Update(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
@@ -130,30 +130,30 @@ func (c *customResourceDefinitions) Update(customResourceDefinition *v1beta1.Cus
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
SubResource("status").
Body(customResourceDefinition).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}
// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error {
func (c *customResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("customresourcedefinitions").
Name(name).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *customResourceDefinitions) 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
@@ -163,19 +163,19 @@ func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions,
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do(context.TODO()).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched customResourceDefinition.
func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *customResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Patch(pt).
Resource("customresourcedefinitions").
SubResource(subresources...).
Name(name).
Body(data).
Do(context.TODO()).
Do(ctx).
Into(result)
return
}

View File

@@ -19,6 +19,8 @@ limitations under the License.
package fake
import (
"context"
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
@@ -38,7 +40,7 @@ var customresourcedefinitionsResource = schema.GroupVersionResource{Group: "apie
var customresourcedefinitionsKind = schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1beta1", Kind: "CustomResourceDefinition"}
// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(customresourcedefinitionsResource, name), &v1beta1.CustomResourceDefinition{})
if obj == nil {
@@ -48,7 +50,7 @@ func (c *FakeCustomResourceDefinitions) Get(name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors.
func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
func (c *FakeCustomResourceDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(customresourcedefinitionsResource, customresourcedefinitionsKind, opts), &v1beta1.CustomResourceDefinitionList{})
if obj == nil {
@@ -69,13 +71,13 @@ func (c *FakeCustomResourceDefinitions) List(opts v1.ListOptions) (result *v1bet
}
// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
func (c *FakeCustomResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *FakeCustomResourceDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(customresourcedefinitionsResource, opts))
}
// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(customresourcedefinitionsResource, customResourceDefinition), &v1beta1.CustomResourceDefinition{})
if obj == nil {
@@ -85,7 +87,7 @@ func (c *FakeCustomResourceDefinitions) Create(customResourceDefinition *v1beta1
}
// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(customresourcedefinitionsResource, customResourceDefinition), &v1beta1.CustomResourceDefinition{})
if obj == nil {
@@ -96,7 +98,7 @@ func (c *FakeCustomResourceDefinitions) Update(customResourceDefinition *v1beta1
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) {
func (c *FakeCustomResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateSubresourceAction(customresourcedefinitionsResource, "status", customResourceDefinition), &v1beta1.CustomResourceDefinition{})
if obj == nil {
@@ -106,14 +108,14 @@ func (c *FakeCustomResourceDefinitions) UpdateStatus(customResourceDefinition *v
}
// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
func (c *FakeCustomResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(customresourcedefinitionsResource, name), &v1beta1.CustomResourceDefinition{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.CustomResourceDefinitionList{})
@@ -121,7 +123,7 @@ func (c *FakeCustomResourceDefinitions) DeleteCollection(options *v1.DeleteOptio
}
// Patch applies the patch and returns the patched customResourceDefinition.
func (c *FakeCustomResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
func (c *FakeCustomResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, name, pt, data, subresources...), &v1beta1.CustomResourceDefinition{})
if obj == nil {

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@@ -60,13 +61,13 @@ func NewFilteredCustomResourceDefinitionInformer(client clientset.Interface, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApiextensionsV1().CustomResourceDefinitions().List(options)
return client.ApiextensionsV1().CustomResourceDefinitions().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApiextensionsV1().CustomResourceDefinitions().Watch(options)
return client.ApiextensionsV1().CustomResourceDefinitions().Watch(context.TODO(), options)
},
},
&apiextensionsv1.CustomResourceDefinition{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredCustomResourceDefinitionInformer(client clientset.Interface, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApiextensionsV1beta1().CustomResourceDefinitions().List(options)
return client.ApiextensionsV1beta1().CustomResourceDefinitions().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ApiextensionsV1beta1().CustomResourceDefinitions().Watch(options)
return client.ApiextensionsV1beta1().CustomResourceDefinitions().Watch(context.TODO(), options)
},
},
&apiextensionsv1beta1.CustomResourceDefinition{},

View File

@@ -17,6 +17,7 @@ limitations under the License.
package apiapproval
import (
"context"
"fmt"
"sync"
"time"
@@ -158,7 +159,7 @@ func (c *KubernetesAPIApprovalPolicyConformantConditionController) sync(key stri
crd := inCustomResourceDefinition.DeepCopy()
apihelpers.SetCRDCondition(crd, *cond)
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil

View File

@@ -17,6 +17,7 @@ limitations under the License.
package establish
import (
"context"
"fmt"
"time"
@@ -135,7 +136,7 @@ func (ec *EstablishingController) sync(key string) error {
apiextensionshelpers.SetCRDCondition(crd, establishedCondition)
// Update server with new CRD condition.
_, err = ec.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
_, err = ec.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil

View File

@@ -17,6 +17,7 @@ limitations under the License.
package finalizer
import (
"context"
"fmt"
"reflect"
"time"
@@ -127,7 +128,7 @@ func (c *CRDFinalizer) sync(key string) error {
Reason: "InstanceDeletionInProgress",
Message: "CustomResource deletion is in progress",
})
crd, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
crd, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil
@@ -150,7 +151,7 @@ func (c *CRDFinalizer) sync(key string) error {
cond, deleteErr := c.deleteInstances(crd)
apiextensionshelpers.SetCRDCondition(crd, cond)
if deleteErr != nil {
if _, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd); err != nil {
if _, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd); err != nil {
utilruntime.HandleError(err)
}
return deleteErr
@@ -165,7 +166,7 @@ func (c *CRDFinalizer) sync(key string) error {
}
apiextensionshelpers.CRDRemoveFinalizer(crd, apiextensionsv1.CustomResourceCleanupFinalizer)
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil

View File

@@ -17,6 +17,7 @@ limitations under the License.
package nonstructuralschema
import (
"context"
"fmt"
"sync"
"time"
@@ -159,7 +160,7 @@ func (c *ConditionController) sync(key string) error {
apiextensionshelpers.SetCRDCondition(crd, *cond)
}
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
_, err = c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil

View File

@@ -17,6 +17,7 @@ limitations under the License.
package status
import (
"context"
"fmt"
"reflect"
"strings"
@@ -261,7 +262,7 @@ func (c *NamingConditionController) sync(key string) error {
apiextensionshelpers.SetCRDCondition(crd, namingCondition)
apiextensionshelpers.SetCRDCondition(crd, establishedCondition)
updatedObj, err := c.crdClient.CustomResourceDefinitions().UpdateStatus(crd)
updatedObj, err := c.crdClient.CustomResourceDefinitions().UpdateStatus(context.TODO(), crd)
if apierrors.IsNotFound(err) || apierrors.IsConflict(err) {
// deleted or changed in the meantime, we'll get called again
return nil

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"testing"
"time"
@@ -65,7 +66,7 @@ func TestAPIApproval(t *testing.T) {
t.Fatal(err)
}
err = wait.PollImmediate(100*time.Millisecond, 30*time.Second, func() (bool, error) {
approvedKubeAPI, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(approvedKubeAPI.Name, metav1.GetOptions{})
approvedKubeAPI, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), approvedKubeAPI.Name, metav1.GetOptions{})
if err != nil {
return false, err
}

View File

@@ -945,14 +945,14 @@ func TestNameConflict(t *testing.T) {
}
noxu2Definition := fixtures.NewNoxu2CustomResourceDefinition(apiextensionsv1beta1.NamespaceScoped)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(noxu2Definition)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(context.TODO(), noxu2Definition)
if err != nil {
t.Fatal(err)
}
// A NameConflict occurs
err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxu2Definition.Name, metav1.GetOptions{})
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxu2Definition.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -975,7 +975,7 @@ func TestNameConflict(t *testing.T) {
// Names are now accepted
err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxu2Definition.Name, metav1.GetOptions{})
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxu2Definition.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -1019,7 +1019,7 @@ func TestStatusGetAndPatch(t *testing.T) {
// make sure we don't get 405 Method Not Allowed from Patching CRD/status subresource
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().
Patch(noxuDefinition.Name, types.StrategicMergePatchType,
Patch(context.TODO(), noxuDefinition.Name, types.StrategicMergePatchType,
[]byte(fmt.Sprintf(`{"labels":{"test-label":"dummy"}}`)),
"status")
if err != nil {

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"sync"
"testing"
@@ -75,7 +76,7 @@ func TestChangeCRD(t *testing.T) {
time.Sleep(10 * time.Millisecond)
noxuDefinitionToUpdate, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{})
noxuDefinitionToUpdate, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{})
if err != nil {
t.Error(err)
continue
@@ -89,7 +90,7 @@ func TestChangeCRD(t *testing.T) {
} else {
noxuDefinitionToUpdate.Spec.Versions = noxuDefinitionToUpdate.Spec.Versions[0:1]
}
if _, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(noxuDefinitionToUpdate); err != nil && !apierrors.IsConflict(err) {
if _, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), noxuDefinitionToUpdate); err != nil && !apierrors.IsConflict(err) {
t.Error(err)
continue
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package conversion
import (
"context"
"encoding/json"
"fmt"
"net/http"
@@ -904,7 +905,7 @@ func newConversionTestContext(t *testing.T, apiExtensionsClient clientset.Interf
if err != nil {
t.Fatal(err)
}
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(v1CRD.Name, metav1.GetOptions{})
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), v1CRD.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -943,7 +944,7 @@ func (c *conversionTestContext) versionedClients(ns string) map[string]dynamic.R
}
func (c *conversionTestContext) setConversionWebhook(t *testing.T, webhookClientConfig *apiextensionsv1beta1.WebhookClientConfig, reviewVersions []string) {
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(c.crd.Name, metav1.GetOptions{})
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), c.crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -952,7 +953,7 @@ func (c *conversionTestContext) setConversionWebhook(t *testing.T, webhookClient
WebhookClientConfig: webhookClientConfig,
ConversionReviewVersions: reviewVersions,
}
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err != nil {
t.Fatal(err)
}
@@ -961,7 +962,7 @@ func (c *conversionTestContext) setConversionWebhook(t *testing.T, webhookClient
}
func (c *conversionTestContext) removeConversionWebhook(t *testing.T) {
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(c.crd.Name, metav1.GetOptions{})
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), c.crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -969,7 +970,7 @@ func (c *conversionTestContext) removeConversionWebhook(t *testing.T) {
Strategy: apiextensionsv1beta1.NoneConverter,
}
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err != nil {
t.Fatal(err)
}
@@ -997,14 +998,14 @@ func (c *conversionTestContext) setAndWaitStorageVersion(t *testing.T, version s
}
func (c *conversionTestContext) setStorageVersion(t *testing.T, version string) {
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(c.crd.Name, metav1.GetOptions{})
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), c.crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
for i, v := range crd.Spec.Versions {
crd.Spec.Versions[i].Storage = v.Name == version
}
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err != nil {
t.Fatal(err)
}
@@ -1026,7 +1027,7 @@ func (c *conversionTestContext) waitForStorageVersion(t *testing.T, version stri
}
func (c *conversionTestContext) setServed(t *testing.T, version string, served bool) {
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(c.crd.Name, metav1.GetOptions{})
crd, err := c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), c.crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -1035,7 +1036,7 @@ func (c *conversionTestContext) setServed(t *testing.T, version string, served b
crd.Spec.Versions[i].Served = served
}
}
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
crd, err = c.apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err != nil {
t.Fatal(err)
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"reflect"
"strings"
@@ -206,12 +207,12 @@ func testDefaulting(t *testing.T, watchCache bool) {
var err error
for retry := 0; retry < 10; retry++ {
var obj *apiextensionsv1.CustomResourceDefinition
obj, err = apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
obj, err = apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
update(obj)
obj, err = apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Update(obj)
obj, err = apiExtensionClient.ApiextensionsV1().CustomResourceDefinitions().Update(context.TODO(), obj)
if err != nil && apierrors.IsConflict(err) {
continue
} else if err != nil {

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"testing"
"time"
@@ -156,7 +157,7 @@ func TestFinalizationAndDeletion(t *testing.T) {
}
err = wait.Poll(500*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{})
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{})
return errors.IsNotFound(err), err
})
if !errors.IsNotFound(err) {

View File

@@ -17,6 +17,7 @@ limitations under the License.
package fixtures
import (
"context"
"fmt"
"time"
@@ -325,7 +326,7 @@ func existsInDiscoveryV1(crd *apiextensionsv1.CustomResourceDefinition, apiExten
// the created CR. Please call CreateNewCustomResourceDefinition if you need to
// watch the CR.
func CreateNewCustomResourceDefinitionWatchUnsafe(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1beta1.CustomResourceDefinition, error) {
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd)
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(context.TODO(), crd)
if err != nil {
return nil, err
}
@@ -374,11 +375,11 @@ func CreateNewCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceD
// the created CR. Please call CreateNewV1CustomResourceDefinition if you need to
// watch the CR.
func CreateNewV1CustomResourceDefinitionWatchUnsafe(v1CRD *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) (*apiextensionsv1.CustomResourceDefinition, error) {
v1CRD, err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Create(v1CRD)
v1CRD, err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Create(context.TODO(), v1CRD)
if err != nil {
return nil, err
}
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(v1CRD.Name, metav1.GetOptions{})
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), v1CRD.Name, metav1.GetOptions{})
if err != nil {
return nil, err
}
@@ -402,7 +403,7 @@ func CreateNewV1CustomResourceDefinition(v1CRD *apiextensionsv1.CustomResourceDe
if err != nil {
return nil, err
}
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(v1CRD.Name, metav1.GetOptions{})
crd, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), v1CRD.Name, metav1.GetOptions{})
if err != nil {
return nil, err
}
@@ -506,7 +507,7 @@ func isWatchCachePrimed(crd *apiextensionsv1beta1.CustomResourceDefinition, dyna
// DeleteCustomResourceDefinition deletes a CRD and waits until it disappears from discovery.
func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) error {
if err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Delete(crd.Name, nil); err != nil {
if err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, nil); err != nil {
return err
}
for _, version := range servedVersions(crd) {
@@ -523,7 +524,7 @@ func DeleteCustomResourceDefinition(crd *apiextensionsv1beta1.CustomResourceDefi
// DeleteV1CustomResourceDefinition deletes a CRD and waits until it disappears from discovery.
func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinition, apiExtensionsClient clientset.Interface) error {
if err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Delete(crd.Name, nil); err != nil {
if err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().Delete(context.TODO(), crd.Name, nil); err != nil {
return err
}
for _, version := range servedV1Versions(crd) {
@@ -540,11 +541,11 @@ func DeleteV1CustomResourceDefinition(crd *apiextensionsv1.CustomResourceDefinit
// DeleteCustomResourceDefinitions deletes all CRD matching the provided deleteListOpts and waits until all the CRDs disappear from discovery.
func DeleteCustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExtensionsClient clientset.Interface) error {
list, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().List(deleteListOpts)
list, err := apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().List(context.TODO(), deleteListOpts)
if err != nil {
return err
}
if err = apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().DeleteCollection(nil, deleteListOpts); err != nil {
if err = apiExtensionsClient.ApiextensionsV1beta1().CustomResourceDefinitions().DeleteCollection(context.TODO(), nil, deleteListOpts); err != nil {
return err
}
for _, crd := range list.Items {
@@ -563,11 +564,11 @@ func DeleteCustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExten
// DeleteV1CustomResourceDefinitions deletes all CRD matching the provided deleteListOpts and waits until all the CRDs disappear from discovery.
func DeleteV1CustomResourceDefinitions(deleteListOpts metav1.ListOptions, apiExtensionsClient clientset.Interface) error {
list, err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().List(deleteListOpts)
list, err := apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().List(context.TODO(), deleteListOpts)
if err != nil {
return err
}
if err = apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().DeleteCollection(nil, deleteListOpts); err != nil {
if err = apiExtensionsClient.ApiextensionsV1().CustomResourceDefinitions().DeleteCollection(context.TODO(), nil, deleteListOpts); err != nil {
return err
}
for _, crd := range list.Items {

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"testing"
@@ -80,12 +81,12 @@ func newNamespacedCustomResourceClient(ns string, client dynamic.Interface, crd
// UpdateCustomResourceDefinitionWithRetry updates a CRD, retrying up to 5 times on version conflict errors.
func UpdateCustomResourceDefinitionWithRetry(client clientset.Interface, name string, update func(*apiextensionsv1beta1.CustomResourceDefinition)) (*apiextensionsv1beta1.CustomResourceDefinition, error) {
for i := 0; i < 5; i++ {
crd, err := client.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
crd, err := client.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get CustomResourceDefinition %q: %v", name, err)
}
update(crd)
crd, err = client.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
crd, err = client.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err == nil {
return crd, nil
}
@@ -99,12 +100,12 @@ func UpdateCustomResourceDefinitionWithRetry(client clientset.Interface, name st
// UpdateV1CustomResourceDefinitionWithRetry updates a CRD, retrying up to 5 times on version conflict errors.
func UpdateV1CustomResourceDefinitionWithRetry(client clientset.Interface, name string, update func(*apiextensionsv1.CustomResourceDefinition)) (*apiextensionsv1.CustomResourceDefinition, error) {
for i := 0; i < 5; i++ {
crd, err := client.ApiextensionsV1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
crd, err := client.ApiextensionsV1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return nil, fmt.Errorf("failed to get CustomResourceDefinition %q: %v", name, err)
}
update(crd)
crd, err = client.ApiextensionsV1().CustomResourceDefinitions().Update(crd)
crd, err = client.ApiextensionsV1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err == nil {
return crd, nil
}

View File

@@ -240,7 +240,7 @@ func TestDeRegistrationAndReRegistration(t *testing.T) {
if err := fixtures.DeleteCustomResourceDefinition(noxuDefinition, apiExtensionClient); err != nil {
t.Fatal(err)
}
if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) {
if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) {
t.Fatalf("expected a NotFound error, got:%v", err)
}
if _, err = noxuNamespacedResourceClient.List(metav1.ListOptions{}); err == nil || !errors.IsNotFound(err) {
@@ -252,7 +252,7 @@ func TestDeRegistrationAndReRegistration(t *testing.T) {
}()
func() {
if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) {
if _, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{}); err == nil || !errors.IsNotFound(err) {
t.Fatalf("expected a NotFound error, got:%v", err)
}
noxuDefinition, err := fixtures.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, dynamicClient)

View File

@@ -124,7 +124,7 @@ func TestTableGet(t *testing.T) {
t.Fatal(err)
}
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -388,12 +388,12 @@ func TestColumnsPatch(t *testing.T) {
// error about top-level and per-version columns being mutual exclusive.
patch := []byte(`{"spec":{"versions":[{"name":"v1beta1","served":true,"storage":true,"additionalPrinterColumns":[{"name":"Age","type":"date","JSONPath":".metadata.creationTimestamp"}]},{"name":"v1","served":true,"storage":false,"additionalPrinterColumns":[{"name":"Age2","type":"date","JSONPath":".metadata.creationTimestamp"}]}]}}`)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(crd.Name, types.MergePatchType, patch)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(context.TODO(), crd.Name, types.MergePatchType, patch)
if err != nil {
t.Fatal(err)
}
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -434,12 +434,12 @@ func TestPatchCleanTopLevelColumns(t *testing.T) {
// the top-level columns.
patch := []byte(`{"spec":{"additionalPrinterColumns":null,"versions":[{"name":"v1beta1","served":true,"storage":true,"additionalPrinterColumns":[{"name":"Age","type":"date","JSONPath":".metadata.creationTimestamp"}]},{"name":"v1","served":true,"storage":false,"additionalPrinterColumns":[{"name":"Age2","type":"date","JSONPath":".metadata.creationTimestamp"}]}]}}`)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(crd.Name, types.MergePatchType, patch)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Patch(context.TODO(), crd.Name, types.MergePatchType, patch)
if err != nil {
t.Fatal(err)
}
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"strings"
"testing"
@@ -758,7 +759,7 @@ spec:
// create CRDs
t.Logf("Creating CRD %s", crd.Name)
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd); err != nil {
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(context.TODO(), crd); err != nil {
t.Fatalf("unexpected create error: %v", err)
}
@@ -766,7 +767,7 @@ spec:
t.Log("Waiting for NonStructuralSchema condition")
var cond *apiextensionsv1beta1.CustomResourceDefinitionCondition
err = wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) {
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -783,12 +784,12 @@ spec:
// remove schema
t.Log("Remove schema")
for retry := 0; retry < 5; retry++ {
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
t.Fatalf("unexpected get error: %v", err)
}
crd.Spec.Validation = nil
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd); apierrors.IsConflict(err) {
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd); apierrors.IsConflict(err) {
continue
}
if err != nil {
@@ -802,7 +803,7 @@ spec:
// wait for condition to go away
t.Log("Wait for condition to disappear")
err = wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) {
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -816,12 +817,12 @@ spec:
// readd schema
t.Log("Readd schema")
for retry := 0; retry < 5; retry++ {
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
t.Fatalf("unexpected get error: %v", err)
}
crd.Spec.Validation = &apiextensionsv1beta1.CustomResourceValidation{OpenAPIV3Schema: origSchema}
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd); apierrors.IsConflict(err) {
if _, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd); apierrors.IsConflict(err) {
continue
}
if err != nil {
@@ -835,7 +836,7 @@ spec:
// wait for condition with violations
t.Log("Wait for condition to reappear")
err = wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) {
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(name, metav1.GetOptions{})
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -1608,7 +1609,7 @@ properties:
crd.Name = fmt.Sprintf("foos.%s", crd.Spec.Group)
// create CRDs
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(crd)
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Create(context.TODO(), crd)
if len(tst.expectedCreateErrors) > 0 && err == nil {
t.Fatalf("expected create errors, got none")
} else if len(tst.expectedCreateErrors) == 0 && err != nil {
@@ -1633,7 +1634,7 @@ properties:
// wait for condition to not appear
var cond *apiextensionsv1beta1.CustomResourceDefinitionCondition
err := wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (bool, error) {
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
return false, err
}
@@ -1652,7 +1653,7 @@ properties:
// wait for condition to appear with the given violations
var cond *apiextensionsv1beta1.CustomResourceDefinitionCondition
err = wait.PollImmediate(100*time.Millisecond, wait.ForeverTestTimeout, func() (bool, error) {
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(crd.Name, metav1.GetOptions{})
obj, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), crd.Name, metav1.GetOptions{})
if err != nil {
return false, err
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"net/http"
"reflect"
@@ -210,7 +211,7 @@ func testStoragedVersionInCRDStatus(t *testing.T, ns string, noxuDefinition *api
}
// The storage version list should be initilized to storage version
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{})
crd, err := apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}
@@ -220,11 +221,11 @@ func testStoragedVersionInCRDStatus(t *testing.T, ns string, noxuDefinition *api
// Changing CRD storage version should be reflected immediately
crd.Spec.Versions = versionsV1Beta2Storage
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(crd)
_, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Update(context.TODO(), crd)
if err != nil {
t.Fatal(err)
}
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(noxuDefinition.Name, metav1.GetOptions{})
crd, err = apiExtensionClient.ApiextensionsV1beta1().CustomResourceDefinitions().Get(context.TODO(), noxuDefinition.Name, metav1.GetOptions{})
if err != nil {
t.Fatal(err)
}

View File

@@ -154,7 +154,7 @@ func (l *Lifecycle) Admit(ctx context.Context, a admission.Attributes, o admissi
// refuse to operate on non-existent namespaces
if !exists || forceLiveLookup {
// as a last resort, make a call directly to storage
namespace, err = l.client.CoreV1().Namespaces().Get(a.GetNamespace(), metav1.GetOptions{})
namespace, err = l.client.CoreV1().Namespaces().Get(context.TODO(), a.GetNamespace(), metav1.GetOptions{})
switch {
case errors.IsNotFound(err):
return err

View File

@@ -17,6 +17,7 @@ limitations under the License.
package namespace
import (
"context"
"fmt"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -76,7 +77,7 @@ func (m *Matcher) GetNamespaceLabels(attr admission.Attributes) (map[string]stri
}
if apierrors.IsNotFound(err) {
// in case of latency in our caches, make a call direct to storage to verify that it truly exists or not
namespace, err = m.Client.CoreV1().Namespaces().Get(namespaceName, metav1.GetOptions{})
namespace, err = m.Client.CoreV1().Namespaces().Get(context.TODO(), namespaceName, metav1.GetOptions{})
if err != nil {
return nil, err
}

View File

@@ -17,6 +17,7 @@ limitations under the License.
package options
import (
"context"
"encoding/json"
"fmt"
"strings"
@@ -339,7 +340,7 @@ func (s *DelegatingAuthenticationOptions) createRequestHeaderConfig(client kuber
return nil, fmt.Errorf("unable to create request header authentication config: %v", err)
}
authConfigMap, err := client.CoreV1().ConfigMaps(authenticationConfigMapNamespace).Get(authenticationConfigMapName, metav1.GetOptions{})
authConfigMap, err := client.CoreV1().ConfigMaps(authenticationConfigMapNamespace).Get(context.TODO(), authenticationConfigMapName, metav1.GetOptions{})
switch {
case errors.IsNotFound(err):
// ignore, authConfigMap is nil now

View File

@@ -19,6 +19,7 @@ package main
import (
"bufio"
"context"
"flag"
"fmt"
"os"
@@ -100,7 +101,7 @@ func main() {
// Create Deployment
fmt.Println("Creating deployment...")
result, err := deploymentsClient.Create(deployment)
result, err := deploymentsClient.Create(context.TODO(), deployment)
if err != nil {
panic(err)
}
@@ -125,14 +126,14 @@ func main() {
retryErr := retry.RetryOnConflict(retry.DefaultRetry, func() error {
// Retrieve the latest version of Deployment before attempting update
// RetryOnConflict uses exponential backoff to avoid exhausting the apiserver
result, getErr := deploymentsClient.Get("demo-deployment", metav1.GetOptions{})
result, getErr := deploymentsClient.Get(context.TODO(), "demo-deployment", metav1.GetOptions{})
if getErr != nil {
panic(fmt.Errorf("Failed to get latest version of Deployment: %v", getErr))
}
result.Spec.Replicas = int32Ptr(1) // reduce replica count
result.Spec.Template.Spec.Containers[0].Image = "nginx:1.13" // change nginx version
_, updateErr := deploymentsClient.Update(result)
_, updateErr := deploymentsClient.Update(context.TODO(), result)
return updateErr
})
if retryErr != nil {
@@ -143,7 +144,7 @@ func main() {
// List Deployments
prompt()
fmt.Printf("Listing deployments in namespace %q:\n", apiv1.NamespaceDefault)
list, err := deploymentsClient.List(metav1.ListOptions{})
list, err := deploymentsClient.List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err)
}
@@ -155,7 +156,7 @@ func main() {
prompt()
fmt.Println("Deleting deployment...")
deletePolicy := metav1.DeletePropagationForeground
if err := deploymentsClient.Delete("demo-deployment", &metav1.DeleteOptions{
if err := deploymentsClient.Delete(context.TODO(), "demo-deployment", &metav1.DeleteOptions{
PropagationPolicy: &deletePolicy,
}); err != nil {
panic(err)

View File

@@ -59,7 +59,7 @@ func TestFakeClient(t *testing.T) {
// Inject an event into the fake client.
p := &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "my-pod"}}
_, err := client.CoreV1().Pods("test-ns").Create(p)
_, err := client.CoreV1().Pods("test-ns").Create(context.TODO(), p)
if err != nil {
t.Fatalf("error injecting pod add: %v", err)
}

View File

@@ -18,6 +18,7 @@ limitations under the License.
package main
import (
"context"
"fmt"
"time"
@@ -50,7 +51,7 @@ func main() {
for {
// get pods in all the namespaces by omitting namespace
// Or specify namespace to get pods in particular namespace
pods, err := clientset.CoreV1().Pods("").List(metav1.ListOptions{})
pods, err := clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err.Error())
}
@@ -59,7 +60,7 @@ func main() {
// Examples for error handling:
// - Use helper functions e.g. errors.IsNotFound()
// - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message
_, err = clientset.CoreV1().Pods("default").Get("example-xxxxx", metav1.GetOptions{})
_, err = clientset.CoreV1().Pods("default").Get(context.TODO(), "example-xxxxx", metav1.GetOptions{})
if errors.IsNotFound(err) {
fmt.Printf("Pod example-xxxxx not found in default namespace\n")
} else if statusError, isStatus := err.(*errors.StatusError); isStatus {

View File

@@ -18,6 +18,7 @@ limitations under the License.
package main
import (
"context"
"flag"
"fmt"
"os"
@@ -60,7 +61,7 @@ func main() {
panic(err.Error())
}
for {
pods, err := clientset.CoreV1().Pods("").List(metav1.ListOptions{})
pods, err := clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{})
if err != nil {
panic(err.Error())
}
@@ -71,7 +72,7 @@ func main() {
// - And/or cast to StatusError and use its properties like e.g. ErrStatus.Message
namespace := "default"
pod := "example-xxxxx"
_, err = clientset.CoreV1().Pods(namespace).Get(pod, metav1.GetOptions{})
_, err = clientset.CoreV1().Pods(namespace).Get(context.TODO(), pod, metav1.GetOptions{})
if errors.IsNotFound(err) {
fmt.Printf("Pod %s in namespace %s not found\n", pod, namespace)
} else if statusError, isStatus := err.(*errors.StatusError); isStatus {

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
@@ -60,13 +61,13 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(options)
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(options)
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), options)
},
},
&admissionregistrationv1.MutatingWebhookConfiguration{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
@@ -60,13 +61,13 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(options)
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(options)
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.TODO(), options)
},
},
&admissionregistrationv1.ValidatingWebhookConfiguration{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(options)
return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(options)
return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(context.TODO(), options)
},
},
&admissionregistrationv1beta1.MutatingWebhookConfiguration{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(options)
return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(options)
return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(context.TODO(), options)
},
},
&admissionregistrationv1beta1.ValidatingWebhookConfiguration{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
appsv1 "k8s.io/api/apps/v1"
@@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().ControllerRevisions(namespace).List(options)
return client.AppsV1().ControllerRevisions(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().ControllerRevisions(namespace).Watch(options)
return client.AppsV1().ControllerRevisions(namespace).Watch(context.TODO(), options)
},
},
&appsv1.ControllerRevision{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
appsv1 "k8s.io/api/apps/v1"
@@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().DaemonSets(namespace).List(options)
return client.AppsV1().DaemonSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().DaemonSets(namespace).Watch(options)
return client.AppsV1().DaemonSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1.DaemonSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
appsv1 "k8s.io/api/apps/v1"
@@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().Deployments(namespace).List(options)
return client.AppsV1().Deployments(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().Deployments(namespace).Watch(options)
return client.AppsV1().Deployments(namespace).Watch(context.TODO(), options)
},
},
&appsv1.Deployment{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
appsv1 "k8s.io/api/apps/v1"
@@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().ReplicaSets(namespace).List(options)
return client.AppsV1().ReplicaSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().ReplicaSets(namespace).Watch(options)
return client.AppsV1().ReplicaSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1.ReplicaSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
appsv1 "k8s.io/api/apps/v1"
@@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().StatefulSets(namespace).List(options)
return client.AppsV1().StatefulSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1().StatefulSets(namespace).Watch(options)
return client.AppsV1().StatefulSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1.StatefulSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
appsv1beta1 "k8s.io/api/apps/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().ControllerRevisions(namespace).List(options)
return client.AppsV1beta1().ControllerRevisions(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().ControllerRevisions(namespace).Watch(options)
return client.AppsV1beta1().ControllerRevisions(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta1.ControllerRevision{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
appsv1beta1 "k8s.io/api/apps/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().Deployments(namespace).List(options)
return client.AppsV1beta1().Deployments(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().Deployments(namespace).Watch(options)
return client.AppsV1beta1().Deployments(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta1.Deployment{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
appsv1beta1 "k8s.io/api/apps/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().StatefulSets(namespace).List(options)
return client.AppsV1beta1().StatefulSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta1().StatefulSets(namespace).Watch(options)
return client.AppsV1beta1().StatefulSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta1.StatefulSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
time "time"
appsv1beta2 "k8s.io/api/apps/v1beta2"
@@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().ControllerRevisions(namespace).List(options)
return client.AppsV1beta2().ControllerRevisions(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().ControllerRevisions(namespace).Watch(options)
return client.AppsV1beta2().ControllerRevisions(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta2.ControllerRevision{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
time "time"
appsv1beta2 "k8s.io/api/apps/v1beta2"
@@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().DaemonSets(namespace).List(options)
return client.AppsV1beta2().DaemonSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().DaemonSets(namespace).Watch(options)
return client.AppsV1beta2().DaemonSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta2.DaemonSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
time "time"
appsv1beta2 "k8s.io/api/apps/v1beta2"
@@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().Deployments(namespace).List(options)
return client.AppsV1beta2().Deployments(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().Deployments(namespace).Watch(options)
return client.AppsV1beta2().Deployments(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta2.Deployment{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
time "time"
appsv1beta2 "k8s.io/api/apps/v1beta2"
@@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().ReplicaSets(namespace).List(options)
return client.AppsV1beta2().ReplicaSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().ReplicaSets(namespace).Watch(options)
return client.AppsV1beta2().ReplicaSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta2.ReplicaSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
time "time"
appsv1beta2 "k8s.io/api/apps/v1beta2"
@@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().StatefulSets(namespace).List(options)
return client.AppsV1beta2().StatefulSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AppsV1beta2().StatefulSets(namespace).Watch(options)
return client.AppsV1beta2().StatefulSets(namespace).Watch(context.TODO(), options)
},
},
&appsv1beta2.StatefulSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredAuditSinkInformer(client kubernetes.Interface, resyncPeriod time
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AuditregistrationV1alpha1().AuditSinks().List(options)
return client.AuditregistrationV1alpha1().AuditSinks().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AuditregistrationV1alpha1().AuditSinks().Watch(options)
return client.AuditregistrationV1alpha1().AuditSinks().Watch(context.TODO(), options)
},
},
&auditregistrationv1alpha1.AuditSink{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(options)
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(options)
return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options)
},
},
&autoscalingv1.HorizontalPodAutoscaler{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v2beta1
import (
"context"
time "time"
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1"
@@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(options)
return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(options)
return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options)
},
},
&autoscalingv2beta1.HorizontalPodAutoscaler{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v2beta2
import (
"context"
time "time"
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
@@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(options)
return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(options)
return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options)
},
},
&autoscalingv2beta2.HorizontalPodAutoscaler{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
batchv1 "k8s.io/api/batch/v1"
@@ -61,13 +62,13 @@ func NewFilteredJobInformer(client kubernetes.Interface, namespace string, resyn
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV1().Jobs(namespace).List(options)
return client.BatchV1().Jobs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV1().Jobs(namespace).Watch(options)
return client.BatchV1().Jobs(namespace).Watch(context.TODO(), options)
},
},
&batchv1.Job{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
batchv1beta1 "k8s.io/api/batch/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV1beta1().CronJobs(namespace).List(options)
return client.BatchV1beta1().CronJobs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV1beta1().CronJobs(namespace).Watch(options)
return client.BatchV1beta1().CronJobs(namespace).Watch(context.TODO(), options)
},
},
&batchv1beta1.CronJob{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v2alpha1
import (
"context"
time "time"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
@@ -61,13 +62,13 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV2alpha1().CronJobs(namespace).List(options)
return client.BatchV2alpha1().CronJobs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.BatchV2alpha1().CronJobs(namespace).Watch(options)
return client.BatchV2alpha1().CronJobs(namespace).Watch(context.TODO(), options)
},
},
&batchv2alpha1.CronJob{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CertificatesV1beta1().CertificateSigningRequests().List(options)
return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CertificatesV1beta1().CertificateSigningRequests().Watch(options)
return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options)
},
},
&certificatesv1beta1.CertificateSigningRequest{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
coordinationv1 "k8s.io/api/coordination/v1"
@@ -61,13 +62,13 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1().Leases(namespace).List(options)
return client.CoordinationV1().Leases(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1().Leases(namespace).Watch(options)
return client.CoordinationV1().Leases(namespace).Watch(context.TODO(), options)
},
},
&coordinationv1.Lease{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().Leases(namespace).List(options)
return client.CoordinationV1beta1().Leases(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoordinationV1beta1().Leases(namespace).Watch(options)
return client.CoordinationV1beta1().Leases(namespace).Watch(context.TODO(), options)
},
},
&coordinationv1beta1.Lease{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -60,13 +61,13 @@ func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPerio
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ComponentStatuses().List(options)
return client.CoreV1().ComponentStatuses().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ComponentStatuses().Watch(options)
return client.CoreV1().ComponentStatuses().Watch(context.TODO(), options)
},
},
&corev1.ComponentStatus{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredConfigMapInformer(client kubernetes.Interface, namespace string,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ConfigMaps(namespace).List(options)
return client.CoreV1().ConfigMaps(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ConfigMaps(namespace).Watch(options)
return client.CoreV1().ConfigMaps(namespace).Watch(context.TODO(), options)
},
},
&corev1.ConfigMap{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredEndpointsInformer(client kubernetes.Interface, namespace string,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Endpoints(namespace).List(options)
return client.CoreV1().Endpoints(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Endpoints(namespace).Watch(options)
return client.CoreV1().Endpoints(namespace).Watch(context.TODO(), options)
},
},
&corev1.Endpoints{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Events(namespace).List(options)
return client.CoreV1().Events(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Events(namespace).Watch(options)
return client.CoreV1().Events(namespace).Watch(context.TODO(), options)
},
},
&corev1.Event{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredLimitRangeInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().LimitRanges(namespace).List(options)
return client.CoreV1().LimitRanges(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().LimitRanges(namespace).Watch(options)
return client.CoreV1().LimitRanges(namespace).Watch(context.TODO(), options)
},
},
&corev1.LimitRange{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -60,13 +61,13 @@ func NewFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Namespaces().List(options)
return client.CoreV1().Namespaces().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Namespaces().Watch(options)
return client.CoreV1().Namespaces().Watch(context.TODO(), options)
},
},
&corev1.Namespace{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -60,13 +61,13 @@ func NewFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Dura
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Nodes().List(options)
return client.CoreV1().Nodes().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Nodes().Watch(options)
return client.CoreV1().Nodes().Watch(context.TODO(), options)
},
},
&corev1.Node{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -60,13 +61,13 @@ func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeri
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumes().List(options)
return client.CoreV1().PersistentVolumes().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumes().Watch(options)
return client.CoreV1().PersistentVolumes().Watch(context.TODO(), options)
},
},
&corev1.PersistentVolume{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, names
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumeClaims(namespace).List(options)
return client.CoreV1().PersistentVolumeClaims(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PersistentVolumeClaims(namespace).Watch(options)
return client.CoreV1().PersistentVolumeClaims(namespace).Watch(context.TODO(), options)
},
},
&corev1.PersistentVolumeClaim{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredPodInformer(client kubernetes.Interface, namespace string, resyn
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Pods(namespace).List(options)
return client.CoreV1().Pods(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Pods(namespace).Watch(options)
return client.CoreV1().Pods(namespace).Watch(context.TODO(), options)
},
},
&corev1.Pod{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredPodTemplateInformer(client kubernetes.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PodTemplates(namespace).List(options)
return client.CoreV1().PodTemplates(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().PodTemplates(namespace).Watch(options)
return client.CoreV1().PodTemplates(namespace).Watch(context.TODO(), options)
},
},
&corev1.PodTemplate{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredReplicationControllerInformer(client kubernetes.Interface, names
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ReplicationControllers(namespace).List(options)
return client.CoreV1().ReplicationControllers(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ReplicationControllers(namespace).Watch(options)
return client.CoreV1().ReplicationControllers(namespace).Watch(context.TODO(), options)
},
},
&corev1.ReplicationController{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredResourceQuotaInformer(client kubernetes.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ResourceQuotas(namespace).List(options)
return client.CoreV1().ResourceQuotas(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ResourceQuotas(namespace).Watch(options)
return client.CoreV1().ResourceQuotas(namespace).Watch(context.TODO(), options)
},
},
&corev1.ResourceQuota{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredSecretInformer(client kubernetes.Interface, namespace string, re
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Secrets(namespace).List(options)
return client.CoreV1().Secrets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Secrets(namespace).Watch(options)
return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options)
},
},
&corev1.Secret{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredServiceInformer(client kubernetes.Interface, namespace string, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Services(namespace).List(options)
return client.CoreV1().Services(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().Services(namespace).Watch(options)
return client.CoreV1().Services(namespace).Watch(context.TODO(), options)
},
},
&corev1.Service{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
corev1 "k8s.io/api/core/v1"
@@ -61,13 +62,13 @@ func NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace st
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ServiceAccounts(namespace).List(options)
return client.CoreV1().ServiceAccounts(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CoreV1().ServiceAccounts(namespace).Watch(options)
return client.CoreV1().ServiceAccounts(namespace).Watch(context.TODO(), options)
},
},
&corev1.ServiceAccount{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
@@ -61,13 +62,13 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1alpha1().EndpointSlices(namespace).List(options)
return client.DiscoveryV1alpha1().EndpointSlices(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1alpha1().EndpointSlices(namespace).Watch(options)
return client.DiscoveryV1alpha1().EndpointSlices(namespace).Watch(context.TODO(), options)
},
},
&discoveryv1alpha1.EndpointSlice{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1beta1().EndpointSlices(namespace).List(options)
return client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(options)
return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.TODO(), options)
},
},
&discoveryv1beta1.EndpointSlice{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
eventsv1beta1 "k8s.io/api/events/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.EventsV1beta1().Events(namespace).List(options)
return client.EventsV1beta1().Events(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.EventsV1beta1().Events(namespace).Watch(options)
return client.EventsV1beta1().Events(namespace).Watch(context.TODO(), options)
},
},
&eventsv1beta1.Event{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().DaemonSets(namespace).List(options)
return client.ExtensionsV1beta1().DaemonSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(options)
return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(context.TODO(), options)
},
},
&extensionsv1beta1.DaemonSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().Deployments(namespace).List(options)
return client.ExtensionsV1beta1().Deployments(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().Deployments(namespace).Watch(options)
return client.ExtensionsV1beta1().Deployments(namespace).Watch(context.TODO(), options)
},
},
&extensionsv1beta1.Deployment{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().Ingresses(namespace).List(options)
return client.ExtensionsV1beta1().Ingresses(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().Ingresses(namespace).Watch(options)
return client.ExtensionsV1beta1().Ingresses(namespace).Watch(context.TODO(), options)
},
},
&extensionsv1beta1.Ingress{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(options)
return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(options)
return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(context.TODO(), options)
},
},
&extensionsv1beta1.NetworkPolicy{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPer
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().PodSecurityPolicies().List(options)
return client.ExtensionsV1beta1().PodSecurityPolicies().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().PodSecurityPolicies().Watch(options)
return client.ExtensionsV1beta1().PodSecurityPolicies().Watch(context.TODO(), options)
},
},
&extensionsv1beta1.PodSecurityPolicy{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().ReplicaSets(namespace).List(options)
return client.ExtensionsV1beta1().ReplicaSets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(options)
return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(context.TODO(), options)
},
},
&extensionsv1beta1.ReplicaSet{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().FlowSchemas().List(options)
return client.FlowcontrolV1alpha1().FlowSchemas().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().FlowSchemas().Watch(options)
return client.FlowcontrolV1alpha1().FlowSchemas().Watch(context.TODO(), options)
},
},
&flowcontrolv1alpha1.FlowSchema{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface,
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(options)
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(options)
return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(context.TODO(), options)
},
},
&flowcontrolv1alpha1.PriorityLevelConfiguration{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
networkingv1 "k8s.io/api/networking/v1"
@@ -61,13 +62,13 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1().NetworkPolicies(namespace).List(options)
return client.NetworkingV1().NetworkPolicies(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1().NetworkPolicies(namespace).Watch(options)
return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.TODO(), options)
},
},
&networkingv1.NetworkPolicy{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
networkingv1beta1 "k8s.io/api/networking/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1beta1().Ingresses(namespace).List(options)
return client.NetworkingV1beta1().Ingresses(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NetworkingV1beta1().Ingresses(namespace).Watch(options)
return client.NetworkingV1beta1().Ingresses(namespace).Watch(context.TODO(), options)
},
},
&networkingv1beta1.Ingress{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1alpha1().RuntimeClasses().List(options)
return client.NodeV1alpha1().RuntimeClasses().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1alpha1().RuntimeClasses().Watch(options)
return client.NodeV1alpha1().RuntimeClasses().Watch(context.TODO(), options)
},
},
&nodev1alpha1.RuntimeClass{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
nodev1beta1 "k8s.io/api/node/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1beta1().RuntimeClasses().List(options)
return client.NodeV1beta1().RuntimeClasses().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.NodeV1beta1().RuntimeClasses().Watch(options)
return client.NodeV1beta1().RuntimeClasses().Watch(context.TODO(), options)
},
},
&nodev1beta1.RuntimeClass{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@@ -61,13 +62,13 @@ func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespa
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(options)
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(options)
return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options)
},
},
&policyv1beta1.PodDisruptionBudget{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
time "time"
policyv1beta1 "k8s.io/api/policy/v1beta1"
@@ -60,13 +61,13 @@ func NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPer
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodSecurityPolicies().List(options)
return client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PolicyV1beta1().PodSecurityPolicies().Watch(options)
return client.PolicyV1beta1().PodSecurityPolicies().Watch(context.TODO(), options)
},
},
&policyv1beta1.PodSecurityPolicy{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
rbacv1 "k8s.io/api/rbac/v1"
@@ -60,13 +61,13 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().ClusterRoles().List(options)
return client.RbacV1().ClusterRoles().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().ClusterRoles().Watch(options)
return client.RbacV1().ClusterRoles().Watch(context.TODO(), options)
},
},
&rbacv1.ClusterRole{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
rbacv1 "k8s.io/api/rbac/v1"
@@ -60,13 +61,13 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().ClusterRoleBindings().List(options)
return client.RbacV1().ClusterRoleBindings().List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().ClusterRoleBindings().Watch(options)
return client.RbacV1().ClusterRoleBindings().Watch(context.TODO(), options)
},
},
&rbacv1.ClusterRoleBinding{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
rbacv1 "k8s.io/api/rbac/v1"
@@ -61,13 +62,13 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().Roles(namespace).List(options)
return client.RbacV1().Roles(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().Roles(namespace).Watch(options)
return client.RbacV1().Roles(namespace).Watch(context.TODO(), options)
},
},
&rbacv1.Role{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
time "time"
rbacv1 "k8s.io/api/rbac/v1"
@@ -61,13 +62,13 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().RoleBindings(namespace).List(options)
return client.RbacV1().RoleBindings(namespace).List(context.TODO(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1().RoleBindings(namespace).Watch(options)
return client.RbacV1().RoleBindings(namespace).Watch(context.TODO(), options)
},
},
&rbacv1.RoleBinding{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().ClusterRoles().List(options)
return client.RbacV1alpha1().ClusterRoles().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().ClusterRoles().Watch(options)
return client.RbacV1alpha1().ClusterRoles().Watch(context.TODO(), options)
},
},
&rbacv1alpha1.ClusterRole{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
@@ -60,13 +61,13 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().ClusterRoleBindings().List(options)
return client.RbacV1alpha1().ClusterRoleBindings().List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().ClusterRoleBindings().Watch(options)
return client.RbacV1alpha1().ClusterRoleBindings().Watch(context.TODO(), options)
},
},
&rbacv1alpha1.ClusterRoleBinding{},

View File

@@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
time "time"
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
@@ -61,13 +62,13 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().Roles(namespace).List(options)
return client.RbacV1alpha1().Roles(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.RbacV1alpha1().Roles(namespace).Watch(options)
return client.RbacV1alpha1().Roles(namespace).Watch(context.TODO(), options)
},
},
&rbacv1alpha1.Role{},

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