Merge pull request #87597 from mikedanese/rctx

Refactor context handling in rest.Request
This commit is contained in:
Kubernetes Prow Robot 2020-01-29 22:11:03 -08:00 committed by GitHub
commit 60dd5dbd8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
227 changed files with 1542 additions and 1386 deletions

View File

@ -17,6 +17,7 @@ limitations under the License.
package testing
import (
"context"
"fmt"
"io/ioutil"
"net"
@ -133,7 +134,7 @@ func StartTestServer(t Logger, customFlags []string) (result TestServer, err err
default:
}
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do()
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {

View File

@ -17,6 +17,7 @@ limitations under the License.
package app
import (
"context"
"fmt"
"net/http"
"time"
@ -33,7 +34,7 @@ func WaitForAPIServer(client clientset.Interface, timeout time.Duration) error {
err := wait.PollImmediate(time.Second, timeout, func() (bool, error) {
healthStatus := 0
result := client.Discovery().RESTClient().Get().AbsPath("/healthz").Do().StatusCode(&healthStatus)
result := client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&healthStatus)
if result.Error() != nil {
lastErr = fmt.Errorf("failed to get apiserver /healthz status: %v", result.Error())
return false, nil

View File

@ -17,6 +17,7 @@ limitations under the License.
package testing
import (
"context"
"fmt"
"io/ioutil"
"net"
@ -210,7 +211,7 @@ func StartTestServer(t Logger, instanceOptions *TestServerInstanceOptions, custo
default:
}
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do()
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {

View File

@ -17,6 +17,7 @@ limitations under the License.
package testing
import (
"context"
"fmt"
"io/ioutil"
"net"
@ -133,7 +134,7 @@ func StartTestServer(t Logger, customFlags []string) (result TestServer, err err
default:
}
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do()
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {

View File

@ -17,6 +17,7 @@ limitations under the License.
package options
import (
"context"
"fmt"
"io/ioutil"
"net/http"
@ -640,7 +641,7 @@ pluginConfig:
// test the client talks to the endpoint we expect with the credentials we expect
username = ""
_, err = config.Client.Discovery().RESTClient().Get().AbsPath("/").DoRaw()
_, err = config.Client.Discovery().RESTClient().Get().AbsPath("/").DoRaw(context.TODO())
if err != nil {
t.Error(err)
return

View File

@ -135,7 +135,7 @@ func StartTestServer(t Logger, customFlags []string) (result TestServer, err err
default:
}
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do()
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {

View File

@ -17,6 +17,7 @@ limitations under the License.
package apiclient
import (
"context"
"fmt"
"io"
"net/http"
@ -77,7 +78,7 @@ func (w *KubeWaiter) WaitForAPI() error {
start := time.Now()
return wait.PollImmediate(kubeadmconstants.APICallRetryInterval, w.timeout, func() (bool, error) {
healthStatus := 0
w.client.Discovery().RESTClient().Get().AbsPath("/healthz").Do().StatusCode(&healthStatus)
w.client.Discovery().RESTClient().Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&healthStatus)
if healthStatus != http.StatusOK {
return false, nil
}

View File

@ -22,7 +22,7 @@ import (
"time"
v1authenticationapi "k8s.io/api/authentication/v1"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
@ -207,7 +207,7 @@ func (b SAControllerClientBuilder) getAuthenticatedConfig(sa *v1.ServiceAccount,
if err != nil {
return nil, false, err
}
err = client.Get().AbsPath("/apis").Do().Error()
err = client.Get().AbsPath("/apis").Do(context.TODO()).Error()
if apierrors.IsUnauthorized(err) {
klog.Warningf("Token for %s/%s did not authenticate correctly: %v", sa.Namespace, sa.Name, err)
return nil, false, nil

View File

@ -17,6 +17,7 @@ limitations under the License.
package podautoscaler
import (
"context"
"encoding/json"
"fmt"
"io"
@ -55,11 +56,11 @@ import (
_ "k8s.io/kubernetes/pkg/apis/core/install"
)
func (w fakeResponseWrapper) DoRaw() ([]byte, error) {
func (w fakeResponseWrapper) DoRaw(context.Context) ([]byte, error) {
return w.raw, nil
}
func (w fakeResponseWrapper) Stream() (io.ReadCloser, error) {
func (w fakeResponseWrapper) Stream(context.Context) (io.ReadCloser, error) {
return nil, nil
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package metrics
import (
"context"
"encoding/json"
"fmt"
"strings"
@ -27,7 +28,7 @@ import (
metricsapi "k8s.io/metrics/pkg/apis/metrics/v1alpha1"
autoscaling "k8s.io/api/autoscaling/v2beta2"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
clientset "k8s.io/client-go/kubernetes"
@ -68,7 +69,7 @@ func (h *HeapsterMetricsClient) GetResourceMetric(resource v1.ResourceName, name
resultRaw, err := h.services.
ProxyGet(h.heapsterScheme, h.heapsterService, h.heapsterPort, metricPath, params).
DoRaw()
DoRaw(context.TODO())
if err != nil {
return nil, time.Time{}, fmt.Errorf("failed to get pod resource metrics: %v", err)
}
@ -139,7 +140,7 @@ func (h *HeapsterMetricsClient) GetRawMetric(metricName string, namespace string
resultRaw, err := h.services.
ProxyGet(h.heapsterScheme, h.heapsterService, h.heapsterPort, metricPath, map[string]string{"start": startTime.Format(time.RFC3339)}).
DoRaw()
DoRaw(context.TODO())
if err != nil {
return nil, time.Time{}, fmt.Errorf("failed to get pod metrics: %v", err)
}

View File

@ -17,13 +17,14 @@ limitations under the License.
package metrics
import (
"context"
"encoding/json"
"fmt"
"io"
"testing"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
@ -40,11 +41,11 @@ import (
var fixedTimestamp = time.Date(2015, time.November, 10, 12, 30, 0, 0, time.UTC)
func (w fakeResponseWrapper) DoRaw() ([]byte, error) {
func (w fakeResponseWrapper) DoRaw(context.Context) ([]byte, error) {
return w.raw, nil
}
func (w fakeResponseWrapper) Stream() (io.ReadCloser, error) {
func (w fakeResponseWrapper) Stream(context.Context) (io.ReadCloser, error) {
return nil, nil
}

View File

@ -291,7 +291,7 @@ func waitForServer(cfg restclient.Config, deadline time.Duration) error {
var connected bool
wait.JitterUntil(func() {
if _, err := cli.Get().AbsPath("/healthz").Do().Raw(); err != nil {
if _, err := cli.Get().AbsPath("/healthz").Do(context.TODO()).Raw(); err != nil {
klog.Infof("Failed to connect to apiserver: %v", err)
return
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package certificate
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
@ -198,7 +199,7 @@ func TestRotateShutsDownConnections(t *testing.T) {
t.Fatal(err)
}
if err := client.Get().Do().Error(); err != nil {
if err := client.Get().Do(context.TODO()).Error(); err != nil {
t.Fatal(err)
}
firstCertSerial := lastSerialNumber()
@ -209,7 +210,7 @@ func TestRotateShutsDownConnections(t *testing.T) {
for i := 0; i < 5; i++ {
time.Sleep(time.Millisecond * 10)
client.Get().Do()
client.Get().Do(context.TODO())
if firstCertSerial.Cmp(lastSerialNumber()) != 0 {
// The certificate changed!
return

View File

@ -17,6 +17,7 @@ limitations under the License.
package master
import (
"context"
"fmt"
"net"
"net/http"
@ -210,7 +211,7 @@ func (c *Controller) RunKubernetesService(ch chan struct{}) {
// wait until process is ready
wait.PollImmediateUntil(100*time.Millisecond, func() (bool, error) {
var code int
c.healthClient.Get().AbsPath("/healthz").Do().StatusCode(&code)
c.healthClient.Get().AbsPath("/healthz").Do(context.TODO()).StatusCode(&code)
return code == http.StatusOK, nil
}, ch)

View File

@ -174,7 +174,7 @@ func (a *Plugin) admitPod(ctx context.Context, pod *api.Pod, attributes admissio
review.Status = entry.(v1alpha1.ImageReviewStatus)
} else {
result := a.webhook.WithExponentialBackoff(ctx, func() rest.Result {
return a.webhook.RestClient.Post().Context(ctx).Body(review).Do()
return a.webhook.RestClient.Post().Body(review).Do(ctx)
})
if err := result.Error(); err != nil {

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1"
@ -70,7 +71,7 @@ func (c *examples) Get(name string, options metav1.GetOptions) (result *v1.Examp
Resource("examples").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *examples) List(opts metav1.ListOptions) (result *v1.ExampleList, err er
Resource("examples").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *examples) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("examples").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// 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.
@ -114,7 +115,7 @@ func (c *examples) Create(example *v1.Example) (result *v1.Example, err error) {
Namespace(c.ns).
Resource("examples").
Body(example).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *examples) Update(example *v1.Example) (result *v1.Example, err error) {
Resource("examples").
Name(example.Name).
Body(example).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *examples) Delete(name string, options *metav1.DeleteOptions) error {
Resource("examples").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *examples) DeleteCollection(options *metav1.DeleteOptions, listOptions m
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *examples) Patch(name string, pt types.PatchType, data []byte, subresour
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -271,7 +271,7 @@ func (c *webhookConverter) Convert(in runtime.Object, toGV schema.GroupVersion)
// TODO: Figure out if adding one second timeout make sense here.
ctx := context.TODO()
r := c.restClient.Post().Context(ctx).Body(request).Do()
r := c.restClient.Post().Body(request).Do(ctx)
if err := r.Into(response); err != nil {
// TODO: Return a webhook specific error to be able to convert it to meta.Status
return nil, fmt.Errorf("conversion webhook for %v failed: %v", in.GetObjectKind().GroupVersionKind(), err)

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
@ -68,7 +69,7 @@ func (c *customResourceDefinitions) Get(name string, options metav1.GetOptions)
Resource("customresourcedefinitions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -84,7 +85,7 @@ func (c *customResourceDefinitions) List(opts metav1.ListOptions) (result *v1.Cu
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -100,7 +101,7 @@ func (c *customResourceDefinitions) Watch(opts metav1.ListOptions) (watch.Interf
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// 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.
@ -109,7 +110,7 @@ func (c *customResourceDefinitions) Create(customResourceDefinition *v1.CustomRe
err = c.client.Post().
Resource("customresourcedefinitions").
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -121,7 +122,7 @@ func (c *customResourceDefinitions) Update(customResourceDefinition *v1.CustomRe
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -136,7 +137,7 @@ func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1.Cu
Name(customResourceDefinition.Name).
SubResource("status").
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *customResourceDefinitions) Delete(name string, options *metav1.DeleteOp
Resource("customresourcedefinitions").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -162,7 +163,7 @@ func (c *customResourceDefinitions) DeleteCollection(options *metav1.DeleteOptio
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -174,7 +175,7 @@ func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
@ -68,7 +69,7 @@ func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (res
Resource("customresourcedefinitions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -84,7 +85,7 @@ func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.C
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -100,7 +101,7 @@ func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface,
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// 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.
@ -109,7 +110,7 @@ func (c *customResourceDefinitions) Create(customResourceDefinition *v1beta1.Cus
err = c.client.Post().
Resource("customresourcedefinitions").
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -121,7 +122,7 @@ func (c *customResourceDefinitions) Update(customResourceDefinition *v1beta1.Cus
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -136,7 +137,7 @@ func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1bet
Name(customResourceDefinition.Name).
SubResource("status").
Body(customResourceDefinition).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOption
Resource("customresourcedefinitions").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -162,7 +163,7 @@ func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions,
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -174,7 +175,7 @@ func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package testing
import (
"context"
"fmt"
"io/ioutil"
"net"
@ -170,7 +171,7 @@ func StartTestServer(t Logger, instanceOptions *TestServerInstanceOptions, custo
default:
}
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do()
result := client.CoreV1().RESTClient().Get().AbsPath("/healthz").Do(context.TODO())
status := 0
result.StatusCode(&status)
if status == 200 {

View File

@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"testing"
@ -73,7 +74,7 @@ values:
Name("mytest").
Param("fieldManager", "apply_test").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -82,7 +83,7 @@ values:
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Name("mytest").
Body([]byte(`{"values":{"numVal": 5}}`)).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -93,7 +94,7 @@ values:
Name("mytest").
Param("fieldManager", "apply_test").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err == nil {
t.Fatalf("Expecting to get conflicts when applying object, got no error: %s", result)
}
@ -112,7 +113,7 @@ values:
Param("force", "true").
Param("fieldManager", "apply_test").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"reflect"
"sort"
@ -1010,7 +1011,7 @@ func TestStatusGetAndPatch(t *testing.T) {
Resource("customresourcedefinitions").
Name(noxuDefinition.Name).
SubResource("status").
Do().
Do(context.TODO()).
Into(result)
if err != nil {
t.Fatal(err)

View File

@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"strings"
"testing"
@ -71,7 +72,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsRequestEntityTooLargeError(err) {
t.Errorf("expected too large error, got %v", err)
}
@ -91,7 +92,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsBadRequest(err) {
t.Errorf("expected bad request, got %v", err)
}
@ -111,7 +112,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsBadRequest(err) {
t.Errorf("expected bad request, got %v", err)
}
@ -132,7 +133,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/json").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(jsonBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsRequestEntityTooLargeError(err) {
t.Errorf("expected too large error, got %v", err)
}
@ -153,7 +154,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/json").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(jsonBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsBadRequest(err) {
t.Errorf("expected bad request, got %v", err)
}
@ -174,7 +175,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
SetHeader("Content-Type", "application/json").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(jsonBody).
DoRaw()
DoRaw(context.TODO())
if !apierrors.IsBadRequest(err) {
t.Errorf("expected bad request, got %v", err)
}
@ -183,7 +184,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
// Create instance to allow patching
{
jsonBody := []byte(fmt.Sprintf(`{"apiVersion": %q, "kind": %q, "metadata": {"name": "test"}}`, apiVersion, kind))
_, err := rest.Post().AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).Body(jsonBody).DoRaw()
_, err := rest.Post().AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).Body(jsonBody).DoRaw(context.TODO())
if err != nil {
t.Fatalf("error creating object: %v", err)
}
@ -192,7 +193,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
t.Run("JSONPatchType nested patch under limit", func(t *testing.T) {
patchBody := []byte(`[{"op":"add","path":"/foo","value":` + strings.Repeat("[", 3*1024*1024/2-100) + strings.Repeat("]", 3*1024*1024/2-100) + `}]`)
err = rest.Patch(types.JSONPatchType).AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "test").
Body(patchBody).Do().Error()
Body(patchBody).Do(context.TODO()).Error()
if !apierrors.IsBadRequest(err) {
t.Errorf("expected success or bad request err, got %v", err)
}
@ -200,7 +201,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
t.Run("MergePatchType nested patch under limit", func(t *testing.T) {
patchBody := []byte(`{"value":` + strings.Repeat("[", 3*1024*1024/2-100) + strings.Repeat("]", 3*1024*1024/2-100) + `}`)
err = rest.Patch(types.MergePatchType).AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "test").
Body(patchBody).Do().Error()
Body(patchBody).Do(context.TODO()).Error()
if !apierrors.IsBadRequest(err) {
t.Errorf("expected success or bad request err, got %v", err)
}
@ -208,7 +209,7 @@ values: `+strings.Repeat("[", 3*1024*1024), apiVersion, kind))
t.Run("ApplyPatchType nested patch under limit", func(t *testing.T) {
patchBody := []byte(`{"value":` + strings.Repeat("[", 3*1024*1024/2-100) + strings.Repeat("]", 3*1024*1024/2-100) + `}`)
err = rest.Patch(types.ApplyPatchType).Param("fieldManager", "test").AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "test").
Body(patchBody).Do().Error()
Body(patchBody).Do(context.TODO()).Error()
if !apierrors.IsBadRequest(err) {
t.Errorf("expected bad request err, got %#v", err)
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"fmt"
"testing"
"time"
@ -164,7 +165,7 @@ func TestTableGet(t *testing.T) {
Resource(crd.Spec.Names.Plural).
SetHeader("Accept", fmt.Sprintf("application/json;as=Table;v=%s;g=%s, application/json", metav1beta1.SchemeGroupVersion.Version, metav1beta1.GroupName)).
VersionedParams(&metav1beta1.TableOptions{}, parameterCodec).
Do().
Do(context.TODO()).
Get()
if err != nil {
t.Fatalf("failed to list %v resources: %v", gvk, err)
@ -262,7 +263,7 @@ func TestTableGet(t *testing.T) {
Resource(crd.Spec.Names.Plural).
SetHeader("Accept", fmt.Sprintf("application/json;as=Table;v=%s;g=%s, application/json", metav1.SchemeGroupVersion.Version, metav1.GroupName)).
VersionedParams(&metav1.TableOptions{}, parameterCodec).
Do().
Do(context.TODO()).
Get()
if err != nil {
t.Fatalf("failed to list %v resources: %v", gvk, err)

View File

@ -17,6 +17,7 @@ limitations under the License.
package integration
import (
"context"
"encoding/json"
"fmt"
"net/http"
@ -67,7 +68,7 @@ func TestYAML(t *testing.T) {
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -88,7 +89,7 @@ func TestYAML(t *testing.T) {
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "missingname").
DoRaw()
DoRaw(context.TODO())
if !errors.IsNotFound(err) {
t.Fatalf("expected not found, got %v", err)
}
@ -124,7 +125,7 @@ values:
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -159,7 +160,7 @@ values:
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest").
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err)
}
@ -192,7 +193,7 @@ values:
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -237,7 +238,7 @@ values:
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Param("watch", "true").
DoRaw()
DoRaw(context.TODO())
if !errors.IsNotAcceptable(err) {
t.Fatalf("expected not acceptable error, got %v (%s)", err, string(result))
}
@ -274,7 +275,7 @@ values:
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -315,7 +316,7 @@ values:
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if !errors.IsUnsupportedMediaType(err) {
t.Fatalf("Expected bad request, got %v\n%s", err, string(result))
}
@ -336,7 +337,7 @@ values:
result, err := rest.Delete().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest").
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -398,7 +399,7 @@ spec:
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural).
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -427,7 +428,7 @@ spec:
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "status").
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err)
}
@ -467,7 +468,7 @@ status:
SetHeader("Content-Type", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "status").
Body(yamlBody).
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err, string(result))
}
@ -500,7 +501,7 @@ status:
result, err := rest.Get().
SetHeader("Accept", "application/yaml").
AbsPath("/apis", noxuDefinition.Spec.Group, noxuDefinition.Spec.Version, noxuDefinition.Spec.Names.Plural, "mytest", "scale").
DoRaw()
DoRaw(context.TODO())
if err != nil {
t.Fatal(err)
}

View File

@ -24,6 +24,7 @@ import (
"time"
jsonpatch "github.com/evanphx/json-patch"
apiequality "k8s.io/apimachinery/pkg/api/equality"
"k8s.io/klog"
@ -235,7 +236,7 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss
defer cancel()
}
r := client.Post().Context(ctx).Body(request)
r := client.Post().Body(request)
// if the context has a deadline, set it as a parameter to inform the backend
if deadline, hasDeadline := ctx.Deadline(); hasDeadline {
@ -250,7 +251,7 @@ func (a *mutatingDispatcher) callAttrMutatingHook(ctx context.Context, h *admiss
}
}
if err := r.Do().Into(response); err != nil {
if err := r.Do(ctx).Into(response); err != nil {
return false, &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err}
}
trace.Step("Request completed")

View File

@ -22,7 +22,7 @@ import (
"sync"
"time"
"k8s.io/api/admissionregistration/v1"
v1 "k8s.io/api/admissionregistration/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime/schema"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@ -196,7 +196,7 @@ func (d *validatingDispatcher) callHook(ctx context.Context, h *v1.ValidatingWeb
defer cancel()
}
r := client.Post().Context(ctx).Body(request)
r := client.Post().Body(request)
// if the context has a deadline, set it as a parameter to inform the backend
if deadline, hasDeadline := ctx.Deadline(); hasDeadline {
@ -211,7 +211,7 @@ func (d *validatingDispatcher) callHook(ctx context.Context, h *v1.ValidatingWeb
}
}
if err := r.Do().Into(response); err != nil {
if err := r.Do(ctx).Into(response); err != nil {
return &webhookutil.ErrCallingWebhook{WebhookName: h.Name, Reason: err}
}
trace.Step("Request completed")

View File

@ -37,7 +37,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd/api/v1"
v1 "k8s.io/client-go/tools/clientcmd/api/v1"
)
const (
@ -397,7 +397,7 @@ func TestTLSConfig(t *testing.T) {
wh, err := NewGenericWebhook(runtime.NewScheme(), scheme.Codecs, configFile, groupVersions, retryBackoff)
if err == nil {
err = wh.RestClient.Get().Do().Error()
err = wh.RestClient.Get().Do(context.TODO()).Error()
}
if err == nil {
@ -466,7 +466,7 @@ func TestRequestTimeout(t *testing.T) {
resultCh := make(chan rest.Result)
go func() { resultCh <- wh.RestClient.Get().Do() }()
go func() { resultCh <- wh.RestClient.Get().Do(context.TODO()) }()
select {
case <-time.After(time.Second * 5):
t.Errorf("expected request to timeout after %s", requestTimeout)
@ -552,7 +552,7 @@ func TestWithExponentialBackoff(t *testing.T) {
}
result := wh.WithExponentialBackoff(context.Background(), func() rest.Result {
return wh.RestClient.Get().Do()
return wh.RestClient.Get().Do(context.TODO())
})
var statusCode int
@ -564,7 +564,7 @@ func TestWithExponentialBackoff(t *testing.T) {
}
result = wh.WithExponentialBackoff(context.Background(), func() rest.Result {
return wh.RestClient.Get().Do()
return wh.RestClient.Get().Do(context.TODO())
})
result.StatusCode(&statusCode)

View File

@ -124,7 +124,7 @@ func (b *backend) processEvents(ev ...*auditinternal.Event) error {
// allow enough time for the serialization/deserialization of audit events, which
// contain nested request and response objects plus additional event fields.
defer trace.LogIfLong(time.Duration(50+25*len(list.Items)) * time.Millisecond)
return b.w.RestClient.Post().Body(&list).Do()
return b.w.RestClient.Post().Body(&list).Do(context.TODO())
}).Error()
}

View File

@ -198,7 +198,7 @@ type tokenReviewV1Client struct {
func (t *tokenReviewV1Client) CreateContext(ctx context.Context, review *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) {
result := &authenticationv1.TokenReview{}
err := t.w.RestClient.Post().Context(ctx).Body(review).Do().Into(result)
err := t.w.RestClient.Post().Body(review).Do(ctx).Into(result)
return result, err
}
@ -209,7 +209,7 @@ type tokenReviewV1beta1Client struct {
func (t *tokenReviewV1beta1Client) CreateContext(ctx context.Context, review *authenticationv1.TokenReview) (*authenticationv1.TokenReview, error) {
v1beta1Review := &authenticationv1beta1.TokenReview{Spec: v1SpecToV1beta1Spec(&review.Spec)}
v1beta1Result := &authenticationv1beta1.TokenReview{}
err := t.w.RestClient.Post().Context(ctx).Body(v1beta1Review).Do().Into(v1beta1Result)
err := t.w.RestClient.Post().Body(v1beta1Review).Do(ctx).Into(v1beta1Result)
if err != nil {
return nil, err
}

View File

@ -289,7 +289,7 @@ type subjectAccessReviewV1Client struct {
func (t *subjectAccessReviewV1Client) CreateContext(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview) (*authorizationv1.SubjectAccessReview, error) {
result := &authorizationv1.SubjectAccessReview{}
err := t.w.RestClient.Post().Context(ctx).Body(subjectAccessReview).Do().Into(result)
err := t.w.RestClient.Post().Body(subjectAccessReview).Do(ctx).Into(result)
return result, err
}
@ -300,7 +300,7 @@ type subjectAccessReviewV1beta1Client struct {
func (t *subjectAccessReviewV1beta1Client) CreateContext(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview) (*authorizationv1.SubjectAccessReview, error) {
v1beta1Review := &authorizationv1beta1.SubjectAccessReview{Spec: v1SpecToV1beta1Spec(&subjectAccessReview.Spec)}
v1beta1Result := &authorizationv1beta1.SubjectAccessReview{}
err := t.w.RestClient.Post().Context(ctx).Body(v1beta1Review).Do().Into(v1beta1Result)
err := t.w.RestClient.Post().Body(v1beta1Review).Do(ctx).Into(v1beta1Result)
if err == nil {
subjectAccessReview.Status = v1beta1StatusToV1Status(&v1beta1Result.Status)
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package resource
import (
"context"
"strconv"
"k8s.io/apimachinery/pkg/api/meta"
@ -72,7 +73,7 @@ func (m *Helper) Get(namespace, name string, export bool) (runtime.Object, error
// TODO: I should be part of GetOptions
req.Param("export", strconv.FormatBool(export))
}
return req.Do().Get()
return req.Do(context.TODO()).Get()
}
func (m *Helper) List(namespace, apiVersion string, export bool, options *metav1.ListOptions) (runtime.Object, error) {
@ -84,7 +85,7 @@ func (m *Helper) List(namespace, apiVersion string, export bool, options *metav1
// TODO: I should be part of ListOptions
req.Param("export", strconv.FormatBool(export))
}
return req.Do().Get()
return req.Do(context.TODO()).Get()
}
func (m *Helper) Watch(namespace, apiVersion string, options *metav1.ListOptions) (watch.Interface, error) {
@ -93,7 +94,7 @@ func (m *Helper) Watch(namespace, apiVersion string, options *metav1.ListOptions
NamespaceIfScoped(namespace, m.NamespaceScoped).
Resource(m.Resource).
VersionedParams(options, metav1.ParameterCodec).
Watch()
Watch(context.TODO())
}
func (m *Helper) WatchSingle(namespace, name, resourceVersion string) (watch.Interface, error) {
@ -105,7 +106,7 @@ func (m *Helper) WatchSingle(namespace, name, resourceVersion string) (watch.Int
Watch: true,
FieldSelector: fields.OneTermEqualSelector("metadata.name", name).String(),
}, metav1.ParameterCodec).
Watch()
Watch(context.TODO())
}
func (m *Helper) Delete(namespace, name string) (runtime.Object, error) {
@ -125,7 +126,7 @@ func (m *Helper) DeleteWithOptions(namespace, name string, options *metav1.Delet
Resource(m.Resource).
Name(name).
Body(options).
Do().
Do(context.TODO()).
Get()
}
@ -163,7 +164,7 @@ func (m *Helper) createResource(c RESTClient, resource, namespace string, obj ru
Resource(resource).
VersionedParams(options, metav1.ParameterCodec).
Body(obj).
Do().
Do(context.TODO()).
Get()
}
func (m *Helper) Patch(namespace, name string, pt types.PatchType, data []byte, options *metav1.PatchOptions) (runtime.Object, error) {
@ -179,7 +180,7 @@ func (m *Helper) Patch(namespace, name string, pt types.PatchType, data []byte,
Name(name).
VersionedParams(options, metav1.ParameterCodec).
Body(data).
Do().
Do(context.TODO()).
Get()
}
@ -198,7 +199,7 @@ func (m *Helper) Replace(namespace, name string, overwrite bool, obj runtime.Obj
}
if version == "" && overwrite {
// Retrieve the current version of the object to overwrite the server object
serverObj, err := c.Get().NamespaceIfScoped(namespace, m.NamespaceScoped).Resource(m.Resource).Name(name).Do().Get()
serverObj, err := c.Get().NamespaceIfScoped(namespace, m.NamespaceScoped).Resource(m.Resource).Name(name).Do(context.TODO()).Get()
if err != nil {
// The object does not exist, but we want it to be created
return m.replaceResource(c, m.Resource, namespace, name, obj, options)
@ -222,6 +223,6 @@ func (m *Helper) replaceResource(c RESTClient, resource, namespace, name string,
Name(name).
VersionedParams(options, metav1.ParameterCodec).
Body(obj).
Do().
Do(context.TODO()).
Get()
}

View File

@ -18,6 +18,7 @@ package resource
import (
"bytes"
"context"
"fmt"
"io"
"net/http"
@ -30,6 +31,8 @@ import (
"golang.org/x/text/encoding/unicode"
"golang.org/x/text/transform"
"sigs.k8s.io/kustomize/pkg/fs"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -40,7 +43,6 @@ import (
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/cli-runtime/pkg/kustomize"
"sigs.k8s.io/kustomize/pkg/fs"
)
const (
@ -100,7 +102,7 @@ func (i *Info) Get() (err error) {
obj, err := NewHelper(i.Client, i.Mapping).Get(i.Namespace, i.Name, i.Export)
if err != nil {
if errors.IsNotFound(err) && len(i.Namespace) > 0 && i.Namespace != metav1.NamespaceDefault && i.Namespace != metav1.NamespaceAll {
err2 := i.Client.Get().AbsPath("api", "v1", "namespaces", i.Namespace).Do().Error()
err2 := i.Client.Get().AbsPath("api", "v1", "namespaces", i.Namespace).Do(context.TODO()).Error()
if err2 != nil && errors.IsNotFound(err2) {
return err2
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package discovery
import (
"context"
"encoding/json"
"fmt"
"net/url"
@ -155,7 +156,7 @@ func apiVersionsToAPIGroup(apiVersions *metav1.APIVersions) (apiGroup metav1.API
func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err error) {
// Get the groupVersions exposed at /api
v := &metav1.APIVersions{}
err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v)
err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do(context.TODO()).Into(v)
apiGroup := metav1.APIGroup{}
if err == nil && len(v.Versions) != 0 {
apiGroup = apiVersionsToAPIGroup(v)
@ -166,7 +167,7 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err
// Get the groupVersions exposed at /apis
apiGroupList = &metav1.APIGroupList{}
err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList)
err = d.restClient.Get().AbsPath("/apis").Do(context.TODO()).Into(apiGroupList)
if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
return nil, err
}
@ -196,7 +197,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r
resources = &metav1.APIResourceList{
GroupVersion: groupVersion,
}
err = d.restClient.Get().AbsPath(url.String()).Do().Into(resources)
err = d.restClient.Get().AbsPath(url.String()).Do(context.TODO()).Into(resources)
if err != nil {
// ignore 403 or 404 error to be compatible with an v1.0 server.
if groupVersion == "v1" && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
@ -405,7 +406,7 @@ func ServerPreferredNamespacedResources(d DiscoveryInterface) ([]*metav1.APIReso
// ServerVersion retrieves and parses the server's version (git version).
func (d *DiscoveryClient) ServerVersion() (*version.Info, error) {
body, err := d.restClient.Get().AbsPath("/version").Do().Raw()
body, err := d.restClient.Get().AbsPath("/version").Do(context.TODO()).Raw()
if err != nil {
return nil, err
}
@ -419,12 +420,12 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) {
// OpenAPISchema fetches the open api schema using a rest client and parses the proto.
func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) {
data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do().Raw()
data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do(context.TODO()).Raw()
if err != nil {
if errors.IsForbidden(err) || errors.IsNotFound(err) || errors.IsNotAcceptable(err) {
// single endpoint not found/registered in old server, try to fetch old endpoint
// TODO: remove this when kubectl/client-go don't work with 1.9 server
data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw()
data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do(context.TODO()).Raw()
if err != nil {
return nil, err
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package dynamic
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/api/meta"
@ -111,7 +112,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do()
Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}
@ -146,7 +147,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do()
Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}
@ -182,7 +183,7 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt
AbsPath(append(c.makeURLSegments(name), "status")...).
Body(outBytes).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do()
Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}
@ -214,7 +215,7 @@ func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions,
Delete().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(deleteOptionsByte).
Do()
Do(context.TODO())
return result.Error()
}
@ -232,7 +233,7 @@ func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, lis
AbsPath(c.makeURLSegments("")...).
Body(deleteOptionsByte).
SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1).
Do()
Do(context.TODO())
return result.Error()
}
@ -240,7 +241,7 @@ func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subreso
if len(name) == 0 {
return nil, fmt.Errorf("name is required")
}
result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do()
result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}
@ -256,7 +257,7 @@ func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subreso
}
func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do()
result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}
@ -283,7 +284,7 @@ func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface,
opts.Watch = true
return c.client.client.Get().AbsPath(c.makeURLSegments("")...).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Watch()
Watch(context.TODO())
}
func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) {
@ -295,7 +296,7 @@ func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []by
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(data).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do()
Do(context.TODO())
if err := result.Error(); err != nil {
return nil, err
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/admissionregistration/v1"
@ -67,7 +68,7 @@ func (c *mutatingWebhookConfigurations) Get(name string, options metav1.GetOptio
Resource("mutatingwebhookconfigurations").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *mutatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *mutatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.In
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1.
err = c.client.Post().
Resource("mutatingwebhookconfigurations").
Body(mutatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1.
Resource("mutatingwebhookconfigurations").
Name(mutatingWebhookConfiguration.Name).
Body(mutatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *mutatingWebhookConfigurations) Delete(name string, options *metav1.Dele
Resource("mutatingwebhookconfigurations").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *mutatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteO
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, d
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/admissionregistration/v1"
@ -67,7 +68,7 @@ func (c *validatingWebhookConfigurations) Get(name string, options metav1.GetOpt
Resource("validatingwebhookconfigurations").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *validatingWebhookConfigurations) List(opts metav1.ListOptions) (result
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *validatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration
err = c.client.Post().
Resource("validatingwebhookconfigurations").
Body(validatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration
Resource("validatingwebhookconfigurations").
Name(validatingWebhookConfiguration.Name).
Body(validatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *validatingWebhookConfigurations) Delete(name string, options *metav1.De
Resource("validatingwebhookconfigurations").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *validatingWebhookConfigurations) DeleteCollection(options *metav1.Delet
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType,
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
@ -67,7 +68,7 @@ func (c *mutatingWebhookConfigurations) Get(name string, options v1.GetOptions)
Resource("mutatingwebhookconfigurations").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1bet
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *mutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interf
Resource("mutatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1b
err = c.client.Post().
Resource("mutatingwebhookconfigurations").
Body(mutatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1b
Resource("mutatingwebhookconfigurations").
Name(mutatingWebhookConfiguration.Name).
Body(mutatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *mutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOp
Resource("mutatingwebhookconfigurations").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *mutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptio
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, d
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
@ -67,7 +68,7 @@ func (c *validatingWebhookConfigurations) Get(name string, options v1.GetOptions
Resource("validatingwebhookconfigurations").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1b
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *validatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Inte
Resource("validatingwebhookconfigurations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration
err = c.client.Post().
Resource("validatingwebhookconfigurations").
Body(validatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration
Resource("validatingwebhookconfigurations").
Name(validatingWebhookConfiguration.Name).
Body(validatingWebhookConfiguration).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *validatingWebhookConfigurations) Delete(name string, options *v1.Delete
Resource("validatingwebhookconfigurations").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *validatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOpt
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType,
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/apps/v1"
@ -70,7 +71,7 @@ func (c *controllerRevisions) Get(name string, options metav1.GetOptions) (resul
Resource("controllerrevisions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.Controll
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *controllerRevisions) Watch(opts metav1.ListOptions) (watch.Interface, e
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *controllerRevisions) Create(controllerRevision *v1.ControllerRevision)
Namespace(c.ns).
Resource("controllerrevisions").
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *controllerRevisions) Update(controllerRevision *v1.ControllerRevision)
Resource("controllerrevisions").
Name(controllerRevision.Name).
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *controllerRevisions) Delete(name string, options *metav1.DeleteOptions)
Resource("controllerrevisions").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *controllerRevisions) DeleteCollection(options *metav1.DeleteOptions, li
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/apps/v1"
@ -71,7 +72,7 @@ func (c *daemonSets) Get(name string, options metav1.GetOptions) (result *v1.Dae
Resource("daemonsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *daemonSets) List(opts metav1.ListOptions) (result *v1.DaemonSetList, er
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *daemonSets) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *daemonSets) Create(daemonSet *v1.DaemonSet) (result *v1.DaemonSet, err
Namespace(c.ns).
Resource("daemonsets").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *daemonSets) Update(daemonSet *v1.DaemonSet) (result *v1.DaemonSet, err
Resource("daemonsets").
Name(daemonSet.Name).
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *daemonSets) UpdateStatus(daemonSet *v1.DaemonSet) (result *v1.DaemonSet
Name(daemonSet.Name).
SubResource("status").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *daemonSets) Delete(name string, options *metav1.DeleteOptions) error {
Resource("daemonsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *daemonSets) DeleteCollection(options *metav1.DeleteOptions, listOptions
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/apps/v1"
@ -75,7 +76,7 @@ func (c *deployments) Get(name string, options metav1.GetOptions) (result *v1.De
Resource("deployments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -92,7 +93,7 @@ func (c *deployments) List(opts metav1.ListOptions) (result *v1.DeploymentList,
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -109,7 +110,7 @@ func (c *deployments) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
@ -119,7 +120,7 @@ func (c *deployments) Create(deployment *v1.Deployment) (result *v1.Deployment,
Namespace(c.ns).
Resource("deployments").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -132,7 +133,7 @@ func (c *deployments) Update(deployment *v1.Deployment) (result *v1.Deployment,
Resource("deployments").
Name(deployment.Name).
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -148,7 +149,7 @@ func (c *deployments) UpdateStatus(deployment *v1.Deployment) (result *v1.Deploy
Name(deployment.Name).
SubResource("status").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -160,7 +161,7 @@ func (c *deployments) Delete(name string, options *metav1.DeleteOptions) error {
Resource("deployments").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -176,7 +177,7 @@ func (c *deployments) DeleteCollection(options *metav1.DeleteOptions, listOption
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -189,7 +190,7 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -203,7 +204,7 @@ func (c *deployments) GetScale(deploymentName string, options metav1.GetOptions)
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -217,7 +218,7 @@ func (c *deployments) UpdateScale(deploymentName string, scale *autoscalingv1.Sc
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/apps/v1"
@ -75,7 +76,7 @@ func (c *replicaSets) Get(name string, options metav1.GetOptions) (result *v1.Re
Resource("replicasets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -92,7 +93,7 @@ func (c *replicaSets) List(opts metav1.ListOptions) (result *v1.ReplicaSetList,
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -109,7 +110,7 @@ func (c *replicaSets) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
@ -119,7 +120,7 @@ func (c *replicaSets) Create(replicaSet *v1.ReplicaSet) (result *v1.ReplicaSet,
Namespace(c.ns).
Resource("replicasets").
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -132,7 +133,7 @@ func (c *replicaSets) Update(replicaSet *v1.ReplicaSet) (result *v1.ReplicaSet,
Resource("replicasets").
Name(replicaSet.Name).
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -148,7 +149,7 @@ func (c *replicaSets) UpdateStatus(replicaSet *v1.ReplicaSet) (result *v1.Replic
Name(replicaSet.Name).
SubResource("status").
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -160,7 +161,7 @@ func (c *replicaSets) Delete(name string, options *metav1.DeleteOptions) error {
Resource("replicasets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -176,7 +177,7 @@ func (c *replicaSets) DeleteCollection(options *metav1.DeleteOptions, listOption
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -189,7 +190,7 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -203,7 +204,7 @@ func (c *replicaSets) GetScale(replicaSetName string, options metav1.GetOptions)
Name(replicaSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -217,7 +218,7 @@ func (c *replicaSets) UpdateScale(replicaSetName string, scale *autoscalingv1.Sc
Name(replicaSetName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/apps/v1"
@ -75,7 +76,7 @@ func (c *statefulSets) Get(name string, options metav1.GetOptions) (result *v1.S
Resource("statefulsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -92,7 +93,7 @@ func (c *statefulSets) List(opts metav1.ListOptions) (result *v1.StatefulSetList
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -109,7 +110,7 @@ func (c *statefulSets) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
@ -119,7 +120,7 @@ func (c *statefulSets) Create(statefulSet *v1.StatefulSet) (result *v1.StatefulS
Namespace(c.ns).
Resource("statefulsets").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -132,7 +133,7 @@ func (c *statefulSets) Update(statefulSet *v1.StatefulSet) (result *v1.StatefulS
Resource("statefulsets").
Name(statefulSet.Name).
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -148,7 +149,7 @@ func (c *statefulSets) UpdateStatus(statefulSet *v1.StatefulSet) (result *v1.Sta
Name(statefulSet.Name).
SubResource("status").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -160,7 +161,7 @@ func (c *statefulSets) Delete(name string, options *metav1.DeleteOptions) error
Resource("statefulsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -176,7 +177,7 @@ func (c *statefulSets) DeleteCollection(options *metav1.DeleteOptions, listOptio
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -189,7 +190,7 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -203,7 +204,7 @@ func (c *statefulSets) GetScale(statefulSetName string, options metav1.GetOption
Name(statefulSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -217,7 +218,7 @@ func (c *statefulSets) UpdateScale(statefulSetName string, scale *autoscalingv1.
Name(statefulSetName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
@ -70,7 +71,7 @@ func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v
Resource("controllerrevisions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta1.Control
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *controllerRevisions) Create(controllerRevision *v1beta1.ControllerRevis
Namespace(c.ns).
Resource("controllerrevisions").
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *controllerRevisions) Update(controllerRevision *v1beta1.ControllerRevis
Resource("controllerrevisions").
Name(controllerRevision.Name).
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) err
Resource("controllerrevisions").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOp
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
@ -71,7 +72,7 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.D
Resource("deployments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList,
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.De
Namespace(c.ns).
Resource("deployments").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.De
Resource("deployments").
Name(deployment.Name).
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1be
Name(deployment.Name).
SubResource("status").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error {
Resource("deployments").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
@ -71,7 +72,7 @@ func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta1.
Resource("statefulsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetLis
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *statefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1
Namespace(c.ns).
Resource("statefulsets").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *statefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1
Resource("statefulsets").
Name(statefulSet.Name).
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *statefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (result *v
Name(statefulSet.Name).
SubResource("status").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error {
Resource("statefulsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
@ -70,7 +71,7 @@ func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v
Resource("controllerrevisions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.Control
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error
Resource("controllerrevisions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *controllerRevisions) Create(controllerRevision *v1beta2.ControllerRevis
Namespace(c.ns).
Resource("controllerrevisions").
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *controllerRevisions) Update(controllerRevision *v1beta2.ControllerRevis
Resource("controllerrevisions").
Name(controllerRevision.Name).
Body(controllerRevision).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) err
Resource("controllerrevisions").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOp
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
@ -71,7 +72,7 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta2.Da
Resource("daemonsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta2.DaemonSetList, e
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *daemonSets) Create(daemonSet *v1beta2.DaemonSet) (result *v1beta2.Daemo
Namespace(c.ns).
Resource("daemonsets").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *daemonSets) Update(daemonSet *v1beta2.DaemonSet) (result *v1beta2.Daemo
Resource("daemonsets").
Name(daemonSet.Name).
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *daemonSets) UpdateStatus(daemonSet *v1beta2.DaemonSet) (result *v1beta2
Name(daemonSet.Name).
SubResource("status").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error {
Resource("daemonsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
@ -71,7 +72,7 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta2.D
Resource("deployments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta2.DeploymentList,
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *deployments) Create(deployment *v1beta2.Deployment) (result *v1beta2.De
Namespace(c.ns).
Resource("deployments").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *deployments) Update(deployment *v1beta2.Deployment) (result *v1beta2.De
Resource("deployments").
Name(deployment.Name).
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *deployments) UpdateStatus(deployment *v1beta2.Deployment) (result *v1be
Name(deployment.Name).
SubResource("status").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error {
Resource("deployments").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
@ -71,7 +72,7 @@ func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta2.R
Resource("replicasets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta2.ReplicaSetList,
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("replicasets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *replicaSets) Create(replicaSet *v1beta2.ReplicaSet) (result *v1beta2.Re
Namespace(c.ns).
Resource("replicasets").
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *replicaSets) Update(replicaSet *v1beta2.ReplicaSet) (result *v1beta2.Re
Resource("replicasets").
Name(replicaSet.Name).
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *replicaSets) UpdateStatus(replicaSet *v1beta2.ReplicaSet) (result *v1be
Name(replicaSet.Name).
SubResource("status").
Body(replicaSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error {
Resource("replicasets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta2
import (
"context"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
@ -74,7 +75,7 @@ func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta2.
Resource("statefulsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -91,7 +92,7 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetLis
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -108,7 +109,7 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("statefulsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
@ -118,7 +119,7 @@ func (c *statefulSets) Create(statefulSet *v1beta2.StatefulSet) (result *v1beta2
Namespace(c.ns).
Resource("statefulsets").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *statefulSets) Update(statefulSet *v1beta2.StatefulSet) (result *v1beta2
Resource("statefulsets").
Name(statefulSet.Name).
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *statefulSets) UpdateStatus(statefulSet *v1beta2.StatefulSet) (result *v
Name(statefulSet.Name).
SubResource("status").
Body(statefulSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -159,7 +160,7 @@ func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error {
Resource("statefulsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -175,7 +176,7 @@ func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -188,7 +189,7 @@ func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subre
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -202,7 +203,7 @@ func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (
Name(statefulSetName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -216,7 +217,7 @@ func (c *statefulSets) UpdateScale(statefulSetName string, scale *v1beta2.Scale)
Name(statefulSetName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1alpha1 "k8s.io/api/auditregistration/v1alpha1"
@ -67,7 +68,7 @@ func (c *auditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.A
Resource("auditsinks").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList,
Resource("auditsinks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *auditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("auditsinks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *auditSinks) Create(auditSink *v1alpha1.AuditSink) (result *v1alpha1.Aud
err = c.client.Post().
Resource("auditsinks").
Body(auditSink).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *auditSinks) Update(auditSink *v1alpha1.AuditSink) (result *v1alpha1.Aud
Resource("auditsinks").
Name(auditSink.Name).
Body(auditSink).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *auditSinks) Delete(name string, options *v1.DeleteOptions) error {
Resource("auditsinks").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *auditSinks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *auditSinks) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (resul
func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
result = &authenticationapi.TokenReview{}
err = c.client.Post().
Context(ctx).
Resource("tokenreviews").
Body(tokenReview).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (resul
func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
result = &authenticationapi.TokenReview{}
err = c.client.Post().
Context(ctx).
Resource("tokenreviews").
Body(tokenReview).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,11 +34,10 @@ func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAcc
func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) {
result = &authorizationapi.LocalSubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Namespace(c.ns).
Resource("localsubjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAcces
func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) {
result = &authorizationapi.SelfSubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Resource("selfsubjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesR
func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) {
result = &authorizationapi.SelfSubjectRulesReview{}
err = c.client.Post().
Context(ctx).
Resource("selfsubjectrulesreviews").
Body(srr).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -35,10 +35,9 @@ func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview)
func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {
result = &authorizationapi.SubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Resource("subjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,11 +34,10 @@ func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAcc
func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) {
result = &authorizationapi.LocalSubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Namespace(c.ns).
Resource("localsubjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAcces
func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) {
result = &authorizationapi.SelfSubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Resource("selfsubjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -34,10 +34,9 @@ func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesR
func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) {
result = &authorizationapi.SelfSubjectRulesReview{}
err = c.client.Post().
Context(ctx).
Resource("selfsubjectrulesreviews").
Body(srr).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -35,10 +35,9 @@ func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview)
func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {
result = &authorizationapi.SubjectAccessReview{}
err = c.client.Post().
Context(ctx).
Resource("subjectaccessreviews").
Body(sar).
Do().
Do(ctx).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/autoscaling/v1"
@ -71,7 +72,7 @@ func (c *horizontalPodAutoscalers) Get(name string, options metav1.GetOptions) (
Resource("horizontalpodautoscalers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *horizontalPodAutoscalers) List(opts metav1.ListOptions) (result *v1.Hor
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *horizontalPodAutoscalers) Watch(opts metav1.ListOptions) (watch.Interfa
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.Horizontal
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.Horizontal
Resource("horizontalpodautoscalers").
Name(horizontalPodAutoscaler.Name).
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.Hori
Name(horizontalPodAutoscaler.Name).
SubResource("status").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *metav1.DeleteOpt
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *horizontalPodAutoscalers) DeleteCollection(options *metav1.DeleteOption
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data [
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v2beta1
import (
"context"
"time"
v2beta1 "k8s.io/api/autoscaling/v2beta1"
@ -71,7 +72,7 @@ func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (resu
Resource("horizontalpodautoscalers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta1.Ho
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface,
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta1.Horiz
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta1.Horiz
Resource("horizontalpodautoscalers").
Name(horizontalPodAutoscaler.Name).
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta1
Name(horizontalPodAutoscaler.Name).
SubResource("status").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, l
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data [
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v2beta2
import (
"context"
"time"
v2beta2 "k8s.io/api/autoscaling/v2beta2"
@ -71,7 +72,7 @@ func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (resu
Resource("horizontalpodautoscalers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.Ho
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface,
Resource("horizontalpodautoscalers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta2.Horiz
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta2.Horiz
Resource("horizontalpodautoscalers").
Name(horizontalPodAutoscaler.Name).
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta2
Name(horizontalPodAutoscaler.Name).
SubResource("status").
Body(horizontalPodAutoscaler).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions
Resource("horizontalpodautoscalers").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, l
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data [
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/batch/v1"
@ -71,7 +72,7 @@ func (c *jobs) Get(name string, options metav1.GetOptions) (result *v1.Job, err
Resource("jobs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *jobs) List(opts metav1.ListOptions) (result *v1.JobList, err error) {
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *jobs) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("jobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *jobs) Create(job *v1.Job) (result *v1.Job, err error) {
Namespace(c.ns).
Resource("jobs").
Body(job).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *jobs) Update(job *v1.Job) (result *v1.Job, err error) {
Resource("jobs").
Name(job.Name).
Body(job).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *jobs) UpdateStatus(job *v1.Job) (result *v1.Job, err error) {
Name(job.Name).
SubResource("status").
Body(job).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *jobs) Delete(name string, options *metav1.DeleteOptions) error {
Resource("jobs").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *jobs) DeleteCollection(options *metav1.DeleteOptions, listOptions metav
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *jobs) Patch(name string, pt types.PatchType, data []byte, subresources
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/batch/v1beta1"
@ -71,7 +72,7 @@ func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v1beta1.Cron
Resource("cronjobs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v1beta1.CronJobList, err e
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *cronJobs) Create(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, er
Namespace(c.ns).
Resource("cronjobs").
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *cronJobs) Update(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, er
Resource("cronjobs").
Name(cronJob.Name).
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *cronJobs) UpdateStatus(cronJob *v1beta1.CronJob) (result *v1beta1.CronJ
Name(cronJob.Name).
SubResource("status").
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error {
Resource("cronjobs").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresour
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v2alpha1
import (
"context"
"time"
v2alpha1 "k8s.io/api/batch/v2alpha1"
@ -71,7 +72,7 @@ func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v2alpha1.Cro
Resource("cronjobs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("cronjobs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *cronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob,
Namespace(c.ns).
Resource("cronjobs").
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *cronJobs) Update(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob,
Resource("cronjobs").
Name(cronJob.Name).
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *cronJobs) UpdateStatus(cronJob *v2alpha1.CronJob) (result *v2alpha1.Cro
Name(cronJob.Name).
SubResource("status").
Body(cronJob).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error {
Resource("cronjobs").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresour
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/certificates/v1beta1"
@ -68,7 +69,7 @@ func (c *certificateSigningRequests) Get(name string, options v1.GetOptions) (re
Resource("certificatesigningrequests").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -84,7 +85,7 @@ func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1.
Resource("certificatesigningrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -100,7 +101,7 @@ func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface
Resource("certificatesigningrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any.
@ -109,7 +110,7 @@ func (c *certificateSigningRequests) Create(certificateSigningRequest *v1beta1.C
err = c.client.Post().
Resource("certificatesigningrequests").
Body(certificateSigningRequest).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -121,7 +122,7 @@ func (c *certificateSigningRequests) Update(certificateSigningRequest *v1beta1.C
Resource("certificatesigningrequests").
Name(certificateSigningRequest.Name).
Body(certificateSigningRequest).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -136,7 +137,7 @@ func (c *certificateSigningRequests) UpdateStatus(certificateSigningRequest *v1b
Name(certificateSigningRequest.Name).
SubResource("status").
Body(certificateSigningRequest).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *certificateSigningRequests) Delete(name string, options *v1.DeleteOptio
Resource("certificatesigningrequests").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -162,7 +163,7 @@ func (c *certificateSigningRequests) DeleteCollection(options *v1.DeleteOptions,
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -174,7 +175,7 @@ func (c *certificateSigningRequests) Patch(name string, pt types.PatchType, data
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,6 +17,8 @@ limitations under the License.
package v1beta1
import (
"context"
certificates "k8s.io/api/certificates/v1beta1"
)
@ -31,7 +33,7 @@ func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *c
Name(certificateSigningRequest.Name).
Body(certificateSigningRequest).
SubResource("approval").
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/coordination/v1"
@ -70,7 +71,7 @@ func (c *leases) Get(name string, options metav1.GetOptions) (result *v1.Lease,
Resource("leases").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *leases) List(opts metav1.ListOptions) (result *v1.LeaseList, err error)
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *leases) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *leases) Create(lease *v1.Lease) (result *v1.Lease, err error) {
Namespace(c.ns).
Resource("leases").
Body(lease).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *leases) Update(lease *v1.Lease) (result *v1.Lease, err error) {
Resource("leases").
Name(lease.Name).
Body(lease).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *leases) Delete(name string, options *metav1.DeleteOptions) error {
Resource("leases").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *leases) DeleteCollection(options *metav1.DeleteOptions, listOptions met
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *leases) Patch(name string, pt types.PatchType, data []byte, subresource
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/coordination/v1beta1"
@ -70,7 +71,7 @@ func (c *leases) Get(name string, options v1.GetOptions) (result *v1beta1.Lease,
Resource("leases").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *leases) List(opts v1.ListOptions) (result *v1beta1.LeaseList, err error
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *leases) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("leases").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *leases) Create(lease *v1beta1.Lease) (result *v1beta1.Lease, err error)
Namespace(c.ns).
Resource("leases").
Body(lease).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *leases) Update(lease *v1beta1.Lease) (result *v1beta1.Lease, err error)
Resource("leases").
Name(lease.Name).
Body(lease).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *leases) Delete(name string, options *v1.DeleteOptions) error {
Resource("leases").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *leases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.List
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *leases) Patch(name string, pt types.PatchType, data []byte, subresource
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -67,7 +68,7 @@ func (c *componentStatuses) Get(name string, options metav1.GetOptions) (result
Resource("componentstatuses").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *componentStatuses) List(opts metav1.ListOptions) (result *v1.ComponentS
Resource("componentstatuses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *componentStatuses) Watch(opts metav1.ListOptions) (watch.Interface, err
Resource("componentstatuses").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *componentStatuses) Create(componentStatus *v1.ComponentStatus) (result
err = c.client.Post().
Resource("componentstatuses").
Body(componentStatus).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *componentStatuses) Update(componentStatus *v1.ComponentStatus) (result
Resource("componentstatuses").
Name(componentStatus.Name).
Body(componentStatus).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *componentStatuses) Delete(name string, options *metav1.DeleteOptions) e
Resource("componentstatuses").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -146,7 +147,7 @@ func (c *componentStatuses) DeleteCollection(options *metav1.DeleteOptions, list
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *componentStatuses) Patch(name string, pt types.PatchType, data []byte,
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *configMaps) Get(name string, options metav1.GetOptions) (result *v1.Con
Resource("configmaps").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, er
Resource("configmaps").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *configMaps) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("configmaps").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *configMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap, err
Namespace(c.ns).
Resource("configmaps").
Body(configMap).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *configMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err
Resource("configmaps").
Name(configMap.Name).
Body(configMap).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *configMaps) Delete(name string, options *metav1.DeleteOptions) error {
Resource("configmaps").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *configMaps) DeleteCollection(options *metav1.DeleteOptions, listOptions
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *configMaps) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *endpoints) Get(name string, options metav1.GetOptions) (result *v1.Endp
Resource("endpoints").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *endpoints) List(opts metav1.ListOptions) (result *v1.EndpointsList, err
Resource("endpoints").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *endpoints) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("endpoints").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *endpoints) Create(endpoints *v1.Endpoints) (result *v1.Endpoints, err e
Namespace(c.ns).
Resource("endpoints").
Body(endpoints).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *endpoints) Update(endpoints *v1.Endpoints) (result *v1.Endpoints, err e
Resource("endpoints").
Name(endpoints.Name).
Body(endpoints).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *endpoints) Delete(name string, options *metav1.DeleteOptions) error {
Resource("endpoints").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *endpoints) DeleteCollection(options *metav1.DeleteOptions, listOptions
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *endpoints) Patch(name string, pt types.PatchType, data []byte, subresou
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *events) Get(name string, options metav1.GetOptions) (result *v1.Event,
Resource("events").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *events) List(opts metav1.ListOptions) (result *v1.EventList, err error)
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *events) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *events) Create(event *v1.Event) (result *v1.Event, err error) {
Namespace(c.ns).
Resource("events").
Body(event).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *events) Update(event *v1.Event) (result *v1.Event, err error) {
Resource("events").
Name(event.Name).
Body(event).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *events) Delete(name string, options *metav1.DeleteOptions) error {
Resource("events").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *events) DeleteCollection(options *metav1.DeleteOptions, listOptions met
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *events) Patch(name string, pt types.PatchType, data []byte, subresource
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,9 +17,10 @@ limitations under the License.
package v1
import (
"context"
"fmt"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime"
@ -54,7 +55,7 @@ func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) {
NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0).
Resource("events").
Body(event).
Do().
Do(context.TODO()).
Into(result)
return result, err
}
@ -71,7 +72,7 @@ func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) {
Resource("events").
Name(event.Name).
Body(event).
Do().
Do(context.TODO()).
Into(result)
return result, err
}
@ -91,7 +92,7 @@ func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte)
Resource("events").
Name(incompleteEvent.Name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return result, err
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *limitRanges) Get(name string, options metav1.GetOptions) (result *v1.Li
Resource("limitranges").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *limitRanges) List(opts metav1.ListOptions) (result *v1.LimitRangeList,
Resource("limitranges").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *limitRanges) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("limitranges").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *limitRanges) Create(limitRange *v1.LimitRange) (result *v1.LimitRange,
Namespace(c.ns).
Resource("limitranges").
Body(limitRange).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *limitRanges) Update(limitRange *v1.LimitRange) (result *v1.LimitRange,
Resource("limitranges").
Name(limitRange.Name).
Body(limitRange).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *limitRanges) Delete(name string, options *metav1.DeleteOptions) error {
Resource("limitranges").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *limitRanges) DeleteCollection(options *metav1.DeleteOptions, listOption
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *limitRanges) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -67,7 +68,7 @@ func (c *namespaces) Get(name string, options metav1.GetOptions) (result *v1.Nam
Resource("namespaces").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -83,7 +84,7 @@ func (c *namespaces) List(opts metav1.ListOptions) (result *v1.NamespaceList, er
Resource("namespaces").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -99,7 +100,7 @@ func (c *namespaces) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("namespaces").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any.
@ -108,7 +109,7 @@ func (c *namespaces) Create(namespace *v1.Namespace) (result *v1.Namespace, err
err = c.client.Post().
Resource("namespaces").
Body(namespace).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -120,7 +121,7 @@ func (c *namespaces) Update(namespace *v1.Namespace) (result *v1.Namespace, err
Resource("namespaces").
Name(namespace.Name).
Body(namespace).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -135,7 +136,7 @@ func (c *namespaces) UpdateStatus(namespace *v1.Namespace) (result *v1.Namespace
Name(namespace.Name).
SubResource("status").
Body(namespace).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -146,7 +147,7 @@ func (c *namespaces) Delete(name string, options *metav1.DeleteOptions) error {
Resource("namespaces").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -158,7 +159,7 @@ func (c *namespaces) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -16,7 +16,11 @@ limitations under the License.
package v1
import "k8s.io/api/core/v1"
import (
"context"
v1 "k8s.io/api/core/v1"
)
// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface.
type NamespaceExpansion interface {
@ -26,6 +30,6 @@ type NamespaceExpansion interface {
// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs.
func (c *namespaces) Finalize(namespace *v1.Namespace) (result *v1.Namespace, err error) {
result = &v1.Namespace{}
err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result)
err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do(context.TODO()).Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -68,7 +69,7 @@ func (c *nodes) Get(name string, options metav1.GetOptions) (result *v1.Node, er
Resource("nodes").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -84,7 +85,7 @@ func (c *nodes) List(opts metav1.ListOptions) (result *v1.NodeList, err error) {
Resource("nodes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -100,7 +101,7 @@ func (c *nodes) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("nodes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any.
@ -109,7 +110,7 @@ func (c *nodes) Create(node *v1.Node) (result *v1.Node, err error) {
err = c.client.Post().
Resource("nodes").
Body(node).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -121,7 +122,7 @@ func (c *nodes) Update(node *v1.Node) (result *v1.Node, err error) {
Resource("nodes").
Name(node.Name).
Body(node).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -136,7 +137,7 @@ func (c *nodes) UpdateStatus(node *v1.Node) (result *v1.Node, err error) {
Name(node.Name).
SubResource("status").
Body(node).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *nodes) Delete(name string, options *metav1.DeleteOptions) error {
Resource("nodes").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -162,7 +163,7 @@ func (c *nodes) DeleteCollection(options *metav1.DeleteOptions, listOptions meta
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -174,7 +175,7 @@ func (c *nodes) Patch(name string, pt types.PatchType, data []byte, subresources
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,7 +17,9 @@ limitations under the License.
package v1
import (
"k8s.io/api/core/v1"
"context"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
)
@ -37,7 +39,7 @@ func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) {
Name(nodeName).
SubResource("status").
Body(data).
Do().
Do(context.TODO()).
Into(result)
return result, err
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -68,7 +69,7 @@ func (c *persistentVolumes) Get(name string, options metav1.GetOptions) (result
Resource("persistentvolumes").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -84,7 +85,7 @@ func (c *persistentVolumes) List(opts metav1.ListOptions) (result *v1.Persistent
Resource("persistentvolumes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -100,7 +101,7 @@ func (c *persistentVolumes) Watch(opts metav1.ListOptions) (watch.Interface, err
Resource("persistentvolumes").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any.
@ -109,7 +110,7 @@ func (c *persistentVolumes) Create(persistentVolume *v1.PersistentVolume) (resul
err = c.client.Post().
Resource("persistentvolumes").
Body(persistentVolume).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -121,7 +122,7 @@ func (c *persistentVolumes) Update(persistentVolume *v1.PersistentVolume) (resul
Resource("persistentvolumes").
Name(persistentVolume.Name).
Body(persistentVolume).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -136,7 +137,7 @@ func (c *persistentVolumes) UpdateStatus(persistentVolume *v1.PersistentVolume)
Name(persistentVolume.Name).
SubResource("status").
Body(persistentVolume).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *persistentVolumes) Delete(name string, options *metav1.DeleteOptions) e
Resource("persistentvolumes").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -162,7 +163,7 @@ func (c *persistentVolumes) DeleteCollection(options *metav1.DeleteOptions, list
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -174,7 +175,7 @@ func (c *persistentVolumes) Patch(name string, pt types.PatchType, data []byte,
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -71,7 +72,7 @@ func (c *persistentVolumeClaims) Get(name string, options metav1.GetOptions) (re
Resource("persistentvolumeclaims").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *persistentVolumeClaims) List(opts metav1.ListOptions) (result *v1.Persi
Resource("persistentvolumeclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *persistentVolumeClaims) Watch(opts metav1.ListOptions) (watch.Interface
Resource("persistentvolumeclaims").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *persistentVolumeClaims) Create(persistentVolumeClaim *v1.PersistentVolu
Namespace(c.ns).
Resource("persistentvolumeclaims").
Body(persistentVolumeClaim).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *persistentVolumeClaims) Update(persistentVolumeClaim *v1.PersistentVolu
Resource("persistentvolumeclaims").
Name(persistentVolumeClaim.Name).
Body(persistentVolumeClaim).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *persistentVolumeClaims) UpdateStatus(persistentVolumeClaim *v1.Persiste
Name(persistentVolumeClaim.Name).
SubResource("status").
Body(persistentVolumeClaim).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *persistentVolumeClaims) Delete(name string, options *metav1.DeleteOptio
Resource("persistentvolumeclaims").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *persistentVolumeClaims) DeleteCollection(options *metav1.DeleteOptions,
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *persistentVolumeClaims) Patch(name string, pt types.PatchType, data []b
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -74,7 +75,7 @@ func (c *pods) Get(name string, options metav1.GetOptions) (result *v1.Pod, err
Resource("pods").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -91,7 +92,7 @@ func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) {
Resource("pods").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -108,7 +109,7 @@ func (c *pods) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("pods").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any.
@ -118,7 +119,7 @@ func (c *pods) Create(pod *v1.Pod) (result *v1.Pod, err error) {
Namespace(c.ns).
Resource("pods").
Body(pod).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *pods) Update(pod *v1.Pod) (result *v1.Pod, err error) {
Resource("pods").
Name(pod.Name).
Body(pod).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *pods) UpdateStatus(pod *v1.Pod) (result *v1.Pod, err error) {
Name(pod.Name).
SubResource("status").
Body(pod).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -159,7 +160,7 @@ func (c *pods) Delete(name string, options *metav1.DeleteOptions) error {
Resource("pods").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -175,7 +176,7 @@ func (c *pods) DeleteCollection(options *metav1.DeleteOptions, listOptions metav
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -188,7 +189,7 @@ func (c *pods) Patch(name string, pt types.PatchType, data []byte, subresources
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -202,7 +203,7 @@ func (c *pods) GetEphemeralContainers(podName string, options metav1.GetOptions)
Name(podName).
SubResource("ephemeralcontainers").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -216,7 +217,7 @@ func (c *pods) UpdateEphemeralContainers(podName string, ephemeralContainers *v1
Name(podName).
SubResource("ephemeralcontainers").
Body(ephemeralContainers).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,7 +17,9 @@ limitations under the License.
package v1
import (
"k8s.io/api/core/v1"
"context"
v1 "k8s.io/api/core/v1"
policy "k8s.io/api/policy/v1beta1"
"k8s.io/client-go/kubernetes/scheme"
restclient "k8s.io/client-go/rest"
@ -32,11 +34,11 @@ type PodExpansion interface {
// Bind applies the provided binding to the named pod in the current namespace (binding.Namespace is ignored).
func (c *pods) Bind(binding *v1.Binding) error {
return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).SubResource("binding").Body(binding).Do().Error()
return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).SubResource("binding").Body(binding).Do(context.TODO()).Error()
}
func (c *pods) Evict(eviction *policy.Eviction) error {
return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do().Error()
return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(context.TODO()).Error()
}
// Get constructs a request for getting the logs for a pod

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *podTemplates) Get(name string, options metav1.GetOptions) (result *v1.P
Resource("podtemplates").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *podTemplates) List(opts metav1.ListOptions) (result *v1.PodTemplateList
Resource("podtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *podTemplates) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("podtemplates").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *podTemplates) Create(podTemplate *v1.PodTemplate) (result *v1.PodTempla
Namespace(c.ns).
Resource("podtemplates").
Body(podTemplate).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *podTemplates) Update(podTemplate *v1.PodTemplate) (result *v1.PodTempla
Resource("podtemplates").
Name(podTemplate.Name).
Body(podTemplate).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *podTemplates) Delete(name string, options *metav1.DeleteOptions) error
Resource("podtemplates").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *podTemplates) DeleteCollection(options *metav1.DeleteOptions, listOptio
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *podTemplates) Patch(name string, pt types.PatchType, data []byte, subre
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@ -75,7 +76,7 @@ func (c *replicationControllers) Get(name string, options metav1.GetOptions) (re
Resource("replicationcontrollers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -92,7 +93,7 @@ func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.Repli
Resource("replicationcontrollers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -109,7 +110,7 @@ func (c *replicationControllers) Watch(opts metav1.ListOptions) (watch.Interface
Resource("replicationcontrollers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any.
@ -119,7 +120,7 @@ func (c *replicationControllers) Create(replicationController *v1.ReplicationCon
Namespace(c.ns).
Resource("replicationcontrollers").
Body(replicationController).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -132,7 +133,7 @@ func (c *replicationControllers) Update(replicationController *v1.ReplicationCon
Resource("replicationcontrollers").
Name(replicationController.Name).
Body(replicationController).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -148,7 +149,7 @@ func (c *replicationControllers) UpdateStatus(replicationController *v1.Replicat
Name(replicationController.Name).
SubResource("status").
Body(replicationController).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -160,7 +161,7 @@ func (c *replicationControllers) Delete(name string, options *metav1.DeleteOptio
Resource("replicationcontrollers").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -176,7 +177,7 @@ func (c *replicationControllers) DeleteCollection(options *metav1.DeleteOptions,
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -189,7 +190,7 @@ func (c *replicationControllers) Patch(name string, pt types.PatchType, data []b
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -203,7 +204,7 @@ func (c *replicationControllers) GetScale(replicationControllerName string, opti
Name(replicationControllerName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -217,7 +218,7 @@ func (c *replicationControllers) UpdateScale(replicationControllerName string, s
Name(replicationControllerName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -71,7 +72,7 @@ func (c *resourceQuotas) Get(name string, options metav1.GetOptions) (result *v1
Resource("resourcequotas").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *resourceQuotas) List(opts metav1.ListOptions) (result *v1.ResourceQuota
Resource("resourcequotas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *resourceQuotas) Watch(opts metav1.ListOptions) (watch.Interface, error)
Resource("resourcequotas").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *resourceQuotas) Create(resourceQuota *v1.ResourceQuota) (result *v1.Res
Namespace(c.ns).
Resource("resourcequotas").
Body(resourceQuota).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *resourceQuotas) Update(resourceQuota *v1.ResourceQuota) (result *v1.Res
Resource("resourcequotas").
Name(resourceQuota.Name).
Body(resourceQuota).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *resourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (result *
Name(resourceQuota.Name).
SubResource("status").
Body(resourceQuota).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *resourceQuotas) Delete(name string, options *metav1.DeleteOptions) erro
Resource("resourcequotas").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *resourceQuotas) DeleteCollection(options *metav1.DeleteOptions, listOpt
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *resourceQuotas) Patch(name string, pt types.PatchType, data []byte, sub
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *secrets) Get(name string, options metav1.GetOptions) (result *v1.Secret
Resource("secrets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *secrets) List(opts metav1.ListOptions) (result *v1.SecretList, err erro
Resource("secrets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *secrets) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("secrets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *secrets) Create(secret *v1.Secret) (result *v1.Secret, err error) {
Namespace(c.ns).
Resource("secrets").
Body(secret).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *secrets) Update(secret *v1.Secret) (result *v1.Secret, err error) {
Resource("secrets").
Name(secret.Name).
Body(secret).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *secrets) Delete(name string, options *metav1.DeleteOptions) error {
Resource("secrets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *secrets) DeleteCollection(options *metav1.DeleteOptions, listOptions me
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *secrets) Patch(name string, pt types.PatchType, data []byte, subresourc
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *services) Get(name string, options metav1.GetOptions) (result *v1.Servi
Resource("services").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *services) List(opts metav1.ListOptions) (result *v1.ServiceList, err er
Resource("services").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *services) Watch(opts metav1.ListOptions) (watch.Interface, error) {
Resource("services").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *services) Create(service *v1.Service) (result *v1.Service, err error) {
Namespace(c.ns).
Resource("services").
Body(service).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *services) Update(service *v1.Service) (result *v1.Service, err error) {
Resource("services").
Name(service.Name).
Body(service).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -143,7 +144,7 @@ func (c *services) UpdateStatus(service *v1.Service) (result *v1.Service, err er
Name(service.Name).
SubResource("status").
Body(service).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -155,7 +156,7 @@ func (c *services) Delete(name string, options *metav1.DeleteOptions) error {
Resource("services").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *services) Patch(name string, pt types.PatchType, data []byte, subresour
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1
import (
"context"
"time"
v1 "k8s.io/api/core/v1"
@ -70,7 +71,7 @@ func (c *serviceAccounts) Get(name string, options metav1.GetOptions) (result *v
Resource("serviceaccounts").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *serviceAccounts) List(opts metav1.ListOptions) (result *v1.ServiceAccou
Resource("serviceaccounts").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *serviceAccounts) Watch(opts metav1.ListOptions) (watch.Interface, error
Resource("serviceaccounts").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *serviceAccounts) Create(serviceAccount *v1.ServiceAccount) (result *v1.
Namespace(c.ns).
Resource("serviceaccounts").
Body(serviceAccount).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *serviceAccounts) Update(serviceAccount *v1.ServiceAccount) (result *v1.
Resource("serviceaccounts").
Name(serviceAccount.Name).
Body(serviceAccount).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *serviceAccounts) Delete(name string, options *metav1.DeleteOptions) err
Resource("serviceaccounts").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *serviceAccounts) DeleteCollection(options *metav1.DeleteOptions, listOp
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *serviceAccounts) Patch(name string, pt types.PatchType, data []byte, su
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,6 +17,8 @@ limitations under the License.
package v1
import (
"context"
authenticationv1 "k8s.io/api/authentication/v1"
)
@ -35,7 +37,7 @@ func (c *serviceAccounts) CreateToken(name string, tr *authenticationv1.TokenReq
SubResource("token").
Name(name).
Body(tr).
Do().
Do(context.TODO()).
Into(result)
return result, err
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1alpha1
import (
"context"
"time"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
@ -70,7 +71,7 @@ func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1alph
Resource("endpointslices").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *endpointSlices) List(opts v1.ListOptions) (result *v1alpha1.EndpointSli
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *endpointSlices) Create(endpointSlice *v1alpha1.EndpointSlice) (result *
Namespace(c.ns).
Resource("endpointslices").
Body(endpointSlice).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *endpointSlices) Update(endpointSlice *v1alpha1.EndpointSlice) (result *
Resource("endpointslices").
Name(endpointSlice.Name).
Body(endpointSlice).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error {
Resource("endpointslices").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, sub
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/discovery/v1beta1"
@ -70,7 +71,7 @@ func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1beta
Resource("endpointslices").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *endpointSlices) List(opts v1.ListOptions) (result *v1beta1.EndpointSlic
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("endpointslices").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *endpointSlices) Create(endpointSlice *v1beta1.EndpointSlice) (result *v
Namespace(c.ns).
Resource("endpointslices").
Body(endpointSlice).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *endpointSlices) Update(endpointSlice *v1beta1.EndpointSlice) (result *v
Resource("endpointslices").
Name(endpointSlice.Name).
Body(endpointSlice).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error {
Resource("endpointslices").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, sub
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/events/v1beta1"
@ -70,7 +71,7 @@ func (c *events) Get(name string, options v1.GetOptions) (result *v1beta1.Event,
Resource("events").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -87,7 +88,7 @@ func (c *events) List(opts v1.ListOptions) (result *v1beta1.EventList, err error
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -104,7 +105,7 @@ func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("events").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any.
@ -114,7 +115,7 @@ func (c *events) Create(event *v1beta1.Event) (result *v1beta1.Event, err error)
Namespace(c.ns).
Resource("events").
Body(event).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -127,7 +128,7 @@ func (c *events) Update(event *v1beta1.Event) (result *v1beta1.Event, err error)
Resource("events").
Name(event.Name).
Body(event).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -139,7 +140,7 @@ func (c *events) Delete(name string, options *v1.DeleteOptions) error {
Resource("events").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -155,7 +156,7 @@ func (c *events) DeleteCollection(options *v1.DeleteOptions, listOptions v1.List
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -168,7 +169,7 @@ func (c *events) Patch(name string, pt types.PatchType, data []byte, subresource
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -17,6 +17,7 @@ limitations under the License.
package v1beta1
import (
"context"
"fmt"
"k8s.io/api/events/v1beta1"
@ -51,7 +52,7 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event,
NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0).
Resource("events").
Body(event).
Do().
Do(context.TODO()).
Into(result)
return result, err
}
@ -72,7 +73,7 @@ func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event,
Resource("events").
Name(event.Name).
Body(event).
Do().
Do(context.TODO()).
Into(result)
return result, err
}
@ -92,7 +93,7 @@ func (e *events) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1
Resource("events").
Name(event.Name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return result, err
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
@ -71,7 +72,7 @@ func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.Da
Resource("daemonsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -88,7 +89,7 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, e
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -105,7 +106,7 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
@ -115,7 +116,7 @@ func (c *daemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.Daemo
Namespace(c.ns).
Resource("daemonsets").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -128,7 +129,7 @@ func (c *daemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.Daemo
Resource("daemonsets").
Name(daemonSet.Name).
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -144,7 +145,7 @@ func (c *daemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (result *v1beta1
Name(daemonSet.Name).
SubResource("status").
Body(daemonSet).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -156,7 +157,7 @@ func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error {
Resource("daemonsets").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -172,7 +173,7 @@ func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -185,7 +186,7 @@ func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subreso
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}

View File

@ -19,6 +19,7 @@ limitations under the License.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
@ -74,7 +75,7 @@ func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.D
Resource("deployments").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -91,7 +92,7 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList,
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -108,7 +109,7 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
Resource("deployments").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
Watch(context.TODO())
}
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
@ -118,7 +119,7 @@ func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.De
Namespace(c.ns).
Resource("deployments").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -131,7 +132,7 @@ func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.De
Resource("deployments").
Name(deployment.Name).
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -147,7 +148,7 @@ func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1be
Name(deployment.Name).
SubResource("status").
Body(deployment).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -159,7 +160,7 @@ func (c *deployments) Delete(name string, options *v1.DeleteOptions) error {
Resource("deployments").
Name(name).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -175,7 +176,7 @@ func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Do(context.TODO()).
Error()
}
@ -188,7 +189,7 @@ func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subres
SubResource(subresources...).
Name(name).
Body(data).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -202,7 +203,7 @@ func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (re
Name(deploymentName).
SubResource("scale").
VersionedParams(&options, scheme.ParameterCodec).
Do().
Do(context.TODO()).
Into(result)
return
}
@ -216,7 +217,7 @@ func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (
Name(deploymentName).
SubResource("scale").
Body(scale).
Do().
Do(context.TODO()).
Into(result)
return
}

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