Commit Graph

23 Commits

Author SHA1 Message Date
Kubernetes Submit Queue
27c093ea90 Merge pull request #32048 from smarterclayton/consistent_errors
Automatic merge from submit-queue

Handle Stream() errors consistently in restclient

We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.

Related to #32009 but isn't the fix (so far)
2016-09-15 20:13:48 -07:00
Clayton Coleman
5e6f5fee8a
Handle Stream() errors consistently in restclient
We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.
2016-09-04 14:50:04 -04:00
Kris
e87edf9bd5 Split path validation into a separate library 2016-08-26 08:05:20 -07:00
Angus Salkeld
c955de2ba8 Make sure the StatusCode is taken into account in DoRaw()
Currently if there is an error (not found) the error printed out
is to do with the inablity to convert an empty body into the expected json.

This patch will fill in the err correctly.

example of before (with NotFound error):
$ kubectl top node
failed to unmarshall heapster response: json: cannot unmarshal object into Go value of type []v1alpha1.NodeMetrics

Now:
$ kubectl top node
the server could not find the requested resource (get services http:heapster:)
2016-08-23 11:42:42 +10:00
Kubernetes Submit Queue
b51d5c3cc0 Merge pull request #30638 from krousey/metrics_registration
Automatic merge from submit-queue

Remove implicit Prometheus metrics from client

**What this PR does / why we need it**: This PR starts to cut away at dependencies that the client has.

**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
The implicit registration of Prometheus metrics for request count and latency have been removed, and a plug-able interface was added. If you were using our client libraries in your own binaries and want these metrics, add the following to your imports in the main package: "k8s.io/pkg/client/metrics/prometheus". 
```

cc: @kubernetes/sig-api-machinery @kubernetes/sig-instrumentation @fgrzadkowski  @wojtek-t
2016-08-21 16:47:05 -07:00
Jordan Liggitt
3e5acd8476
Make client-side fieldSelector stop complaining about identity transforms 2016-08-20 21:34:33 -04:00
Kris
35c695005f Attempt to ensure entire resp body is read 2016-08-19 11:56:02 -07:00
Kris
8d6ce0dcc6 Remove implicit Prometheus metrics from client 2016-08-19 10:11:45 -07:00
Clayton Coleman
203cf2be6f
Use response content-type on restclient errors
Also allow a new AcceptContentTypes field to allow the client to ask for
a fallback serialization when getting responses from the server. This
allows a new client to ask for protobuf and JSON, falling back to JSON
when necessary.

The changes to request.go allow error responses from non-JSON servers to
be properly decoded.
2016-07-24 12:08:40 -04:00
Ryan Hitchman
f1cd578363 Log restclient request/response bodies using %#v.
These are now protobufs, so outputting them with %s dumps a large
amount of binary garbage into the log. %#v properly escapes exotic
characters.
2016-07-13 11:37:16 -07:00
bin liu
426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
bin liu
fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
Clayton Coleman
eeb04e6826
Reset input buffer on retry
Retries were previously sending empty bodies to the server.
2016-05-19 09:08:57 -04:00
Tim Hockin
152c86ab06 Make name validators return string slices 2016-05-18 00:48:01 -07:00
Wojciech Tyczynski
e48116bb75 Client renegotiation 2016-05-12 08:21:11 +02:00
Wojciech Tyczynski
1ea0d46bb3 Set headers in Watch() and Stream() requests 2016-05-09 09:33:13 +02:00
Clayton Coleman
e0ebcf4216
Split the storage and negotiation parts of Codecs
The codec factory should support two distinct interfaces - negotiating
for a serializer with a client, vs reading or writing data to a storage
form (etcd, disk, etc). Make the EncodeForVersion and DecodeToVersion
methods only take Encoder and Decoder, and slight refactoring elsewhere.

In the storage factory, use a content type to control what serializer to
pick, and use the universal deserializer. This ensures that storage can
read JSON (which might be from older objects) while only writing
protobuf. Add exceptions for those resources that may not be able to
write to protobuf (specifically third party resources, but potentially
others in the future).
2016-05-05 12:08:23 -04:00
Wojciech Tyczynski
3aadafd411 Use NegotiatedSerializer in client 2016-05-04 10:57:36 +02:00
harry
8472cfa214 Refactor throttle into util pkg
Fix missing throttle.go
2016-03-25 08:32:23 +08:00
AdoHe
6c84fe5a69 change throttling debug output log level 2016-03-18 00:19:53 -04:00
nikhiljindal
b65180c314 Update updatePodWithRetries to get and then update 2016-03-01 14:40:21 -08:00
Kris
e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00