Commit Graph

1873 Commits (032e450ec41f2fb06420e4fd1b0aac44f58c2ff5)

Author SHA1 Message Date
Kubernetes Submit Queue 7d14b568c3 Merge pull request #36001 from smarterclayton/change_double_decode
Automatic merge from submit-queue

Avoid double decoding all client responses

Fixes #35982 

The linked issue uncovered that we were always double decoding the response in restclient for get, list, update, create, and patch.  That's fairly expensive, most especially for list.  This PR refines the behavior of the rest client to avoid double decoding, and does so while minimizing the changes to rest client consumers.

restclient must be able to deal with multiple types of servers. Alter the behavior of restclient.Result#Raw() to not process the body on error, but instead to return the generic error (which still matches the error checking cases in api/error like IsBadRequest). If the caller uses
.Error(), .Into(), or .Get(), try decoding the body as a Status.

For older servers, continue to default apiVersion "v1" when calling restclient.Result#Error(). This was only for 1.1 servers and the extensions group, which we have since fixed.

This removes a double decode of very large objects (like LIST) - we were trying to DecodeInto status, but that ends up decoding the entire result and then throwing it away.  This makes the decode behavior specific to the type of action the user wants.

```release-note
The error handling behavior of `pkg/client/restclient.Result` has changed.  Calls to `Result.Raw()` will no longer parse the body, although they will still return errors that react to `pkg/api/errors.Is*()` as in previous releases.  Callers of `Get()` and `Into()` will continue to receive errors that are parsed from the body if the kind and apiVersion of the body match the `Status` object.

This more closely aligns rest client as a generic RESTful client, while preserving the special Kube API extended error handling for the `Get` and `Into` methods (which most Kube clients use).
```
2016-11-02 11:36:41 -07:00
Clayton Coleman ce187f9c6a
Avoid double decoding all client responses
restclient must be able to deal with multiple types of servers. Alter
the behavior of restclient.Result#Raw() to not process the body on
error, but instead to return the generic error (which still matches the
error checking cases in api/error like IsBadRequest). If the caller uses
.Error(), .Into(), or .Get(), try decoding the body as a Status.

For older servers, continue to default apiVersion "v1" when calling
restclient.Result#Error(). This was only for 1.1 servers and the
extensions group, which we have since fixed.

This removes a double decode of very large objects (like LIST).
2016-11-01 22:55:51 -04:00
Mike Danese bdcb4a9784 remove orphaned build file 2016-11-01 15:13:40 -07:00
Mike Danese 1c89526963 autogenerated 2016-11-01 15:13:27 -07:00
Kubernetes Submit Queue 1fa8369074 Merge pull request #35639 from ncdc/lister-gen
Automatic merge from submit-queue

Add tooling to generate listers

Add lister-gen tool to auto-generate listers. So far this PR only demonstrates replacing the manually-written `StoreToLimitRangeLister` with the generated `LimitRangeLister`, as it's a small and easy swap.

cc @deads2k @liggitt @sttts @nikhiljindal @lavalamp @smarterclayton @derekwaynecarr  @kubernetes/sig-api-machinery @kubernetes/rh-cluster-infra
2016-11-01 09:29:06 -07:00
Chao Xu 4cf7adf937 remove release_1_4
remove archived federation clientsets
update README
2016-10-31 15:05:26 -07:00
Andy Goldstein 13abf36c60 Update bazel build files 2016-10-31 11:13:44 -04:00
Andy Goldstein 7b85985a72 Add generated listers 2016-10-31 11:13:43 -04:00
Chao Xu 2044927034 move watch.ListWatchUntil to its own package to avoid future import cycle 2016-10-30 13:14:20 -07:00
Kubernetes Submit Queue a06a08a906 Merge pull request #34489 from caesarxuchao/time-copy.sh
Automatic merge from submit-queue

Verify and update client-go staging area for every PR

We need to keep the staging area up-to-date to prevent PRs from breaking client-go.

It's marked as "WIP" because we need to decide the [versioning strategy](https://github.com/kubernetes/client-go/issues/9) for client-go first. This PR contains breaking changes for client-go.

This is blocking #29934 and potentially #34441

cc @kubernetes/sig-api-machinery
2016-10-29 16:24:07 -07:00
Chao Xu fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Kubernetes Submit Queue 620788a795 Merge pull request #35230 from deads2k/controller-12-sa-controller
Automatic merge from submit-queue

convert SA controller to shared informers

convert the SA controller to shared informer + workqueue.

I think one of @derekwaynecarr @ncdc or @liggitt
2016-10-29 10:09:46 -07:00
Kubernetes Submit Queue 17e4156163 Merge pull request #35785 from piosz/clientset
Automatic merge from submit-queue

Removed 1.3 clientset

needed for #35782
2016-10-29 08:37:04 -07:00
Clayton Coleman ca2f1b87ad
Replace negotiation with a new method that can extract info
Alter how runtime.SerializeInfo is represented to simplify negotiation
and reduce the need to allocate during negotiation. Simplify the dynamic
client's logic around negotiating type. Add more tests for media type
handling where necessary.
2016-10-28 11:30:11 -04:00
Piotr Szczesniak 0c4fc2abbf Removed 1.3 clientset 2016-10-28 14:40:47 +02:00
Janet Kuo 3febdb7f71 Remove petset from 1.4 generated client to pass import-boss verification 2016-10-27 17:25:10 -07:00
Janet Kuo 74dbfdca97 (Auto-gen) Run update-all.sh, codecgen, munge docs, and bazel 2016-10-27 17:25:10 -07:00
Janet Kuo f35a095b50 Manually remove previously generated petset client 2016-10-27 17:25:10 -07:00
Janet Kuo e9927664cf Remove unnecessary dependency in client-gen 2016-10-27 17:25:10 -07:00
Janet Kuo 10aee82ae3 Rename PetSet API to StatefulSet 2016-10-27 17:25:10 -07:00
deads2k df4ed892c4 convert SA controller to shared informers 2016-10-27 15:44:46 -04:00
Kubernetes Submit Queue 5423eaf431 Merge pull request #35431 from deads2k/client-16-remove-old
Automatic merge from submit-queue

remove the non-generated client

Removes the non-generated client from kube.  The package has a few methods left, but nothing that needs updating when adding new groups.

@ingvagabund
2016-10-27 05:12:33 -07:00
deads2k 81ae13084d handle non-generated client removal 2016-10-26 16:10:41 -04:00
deads2k 969e945a9e delete non-generated client 2016-10-26 15:14:41 -04:00
Madhusudan.C.S 63e317598c Make the fake RESTClient usable by all the API groups, not just core. 2016-10-26 00:21:23 -07:00
Kubernetes Submit Queue 5ec053719f Merge pull request #35563 from mikedanese/old-clients
Automatic merge from submit-queue

remove old clients from build

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

**What this PR does / why we need it**:

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-10-25 17:40:38 -07:00
Mike Danese 1682b81295 remove old clients from build 2016-10-25 16:43:19 -07:00
Tim St. Clair 52ed57ec3b
Refactor PortForward server methods into the portforward package 2016-10-25 12:08:35 -07:00
Mike Danese 763c4987f2 autogenerated 2016-10-24 14:47:27 -07:00
Kubernetes Submit Queue 1569a8b04f Merge pull request #35322 from deads2k/controller-14-panic
Automatic merge from submit-queue

prevent panic if resourceversion checked early

Found panic while trying to use this in a separate API server.
2016-10-24 13:38:39 -07:00
deads2k fd65bc8fff prevent panic if resourceversion checked early 2016-10-24 08:25:11 -04:00
Jan Chaloupka 4fde09d308 Replace client with clientset in code 2016-10-23 22:00:35 +02:00
Mike Danese df713b478c fix tests by declaring testdata 2016-10-21 17:32:32 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Kubernetes Submit Queue a7807eb5a4 Merge pull request #34138 from ingvagabund/create-restclient-interface
Automatic merge from submit-queue

Create restclient interface

Refactoring of code to allow replace *restclient.RESTClient with any RESTClient implementation that implements restclient.RESTClientInterface interface.
2016-10-21 16:02:04 -07:00
deads2k a0a0e61f62 add generic shared informer backed by existing informer 2016-10-21 08:39:09 -04:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Kubernetes Submit Queue 71471c2330 Merge pull request #34740 from derekwaynecarr/storage-class-informer
Automatic merge from submit-queue

Add an informer for StorageClass

Add an informer for `StorageClass` for later consumption in quota.

/cc @eparis @deads2k @erinboyd
2016-10-20 23:36:58 -07:00
Kubernetes Submit Queue 6306ab00d2 Merge pull request #34845 from derekwaynecarr/make_pvc_informer_list
Automatic merge from submit-queue

PVC informer lister supports listing

This will be used in follow-on PRs for quota evaluation backed by informers for pvcs.

/cc @deads2k @eparis @kubernetes/sig-storage
2016-10-19 19:29:02 -07:00
Chao Xu 45432750df add import restriction to clientset 2016-10-19 11:47:51 -07:00
derekwaynecarr 39da9d19f0 Add an informer for StorageClass 2016-10-19 12:26:57 -04:00
Clayton Coleman 1694cfb72d
Make defaulting part of versioning codec
Most normal codec use should perform defaulting. DirectCodecs should not
perform defaulting. Update the defaulting_test to fuzz the list of known
defaulters. Use the new versioning.NewDefaultingCodec() method.
2016-10-18 21:07:35 -04:00
Kubernetes Submit Queue a31482207f Merge pull request #34960 from sdminonne/serviceaccount_informer
Automatic merge from submit-queue

To add service account informer

@deads2k  this PR adds ServiceAccount informer as discussed [here](https://github.com/openshift/origin/pull/11330#issuecomment-253216303)
2016-10-18 16:21:41 -07:00
Kubernetes Submit Queue 4b7024efe7 Merge pull request #27784 from deads2k/catch-mutators
Automatic merge from submit-queue

add optional mutation checks for shared informer cache

We need to make sure that no one is mutating caches if they're using a shared informer.  It is important that whatever is tracking those changes gets the object *before* anyone else possibly could.

This adds the ability to track the original objects in the cache and their current values.  Go doesn't have an exit hook or a way to say "wait for non-daemon go-funcs to complete before exit", so this runs a gofunc on a loop that can panic the entire process.  It's gated behind an env var.

@derekwaynecarr did I get the right spots to make sure that e2e runs with this flag?
@smarterclayton @kubernetes/rh-cluster-infra
2016-10-18 14:38:57 -07:00
derekwaynecarr 555231fad7 PVC informer lister supports listing 2016-10-18 14:36:33 -04:00
Kubernetes Submit Queue b77e13444f Merge pull request #34939 from wojtek-t/throttle_retried_requests
Automatic merge from submit-queue

Throttle retried requests in client

Fix #34938
2016-10-18 10:08:53 -07:00
deads2k aee54ae57e add optional mutation checks for shared informer cache 2016-10-18 09:19:38 -04:00
Kubernetes Submit Queue e6cc8ff149 Merge pull request #34498 from mml/remotecommand-golint
Automatic merge from submit-queue

Fix lint error in remotecommand.go

Before:

```
pkg/client/unversioned/remotecommand/remotecommand.go:101:9: should omit type http.RoundTripper from declaration of var rt; it will be inferred from the right-hand side

Please fix the above errors. You can test via "golint" and commit the result.
```
2016-10-18 03:35:21 -07:00
Salvatore Dario Minonne a745872b94 To add service account informer 2016-10-18 09:24:54 +02:00