From a5c672885d28cbcef34cd98e2414f3c9964f171c Mon Sep 17 00:00:00 2001 From: David Eads Date: Fri, 16 Nov 2018 08:38:57 -0500 Subject: [PATCH] generated Kubernetes-commit: 8f7edec615fb9cd722b7f8310dab3efa25351b7c --- .../typed/samplecontroller/v1alpha1/foo.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go b/pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go index 667edf52..48bc2152 100644 --- a/pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go +++ b/pkg/client/clientset/versioned/typed/samplecontroller/v1alpha1/foo.go @@ -19,6 +19,8 @@ limitations under the License. package v1alpha1 import ( + "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -76,11 +78,16 @@ func (c *foos) Get(name string, options v1.GetOptions) (result *v1alpha1.Foo, er // List takes label and field selectors, and returns the list of Foos that match those selectors. func (c *foos) List(opts v1.ListOptions) (result *v1alpha1.FooList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } result = &v1alpha1.FooList{} err = c.client.Get(). Namespace(c.ns). Resource("foos"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Do(). Into(result) return @@ -88,11 +95,16 @@ func (c *foos) List(opts v1.ListOptions) (result *v1alpha1.FooList, err error) { // Watch returns a watch.Interface that watches the requested foos. func (c *foos) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("foos"). VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). Watch() } @@ -150,10 +162,15 @@ func (c *foos) Delete(name string, options *v1.DeleteOptions) error { // DeleteCollection deletes a collection of objects. func (c *foos) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } return c.client.Delete(). Namespace(c.ns). Resource("foos"). VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). Body(options). Do(). Error()