Commit Graph

15 Commits

Author SHA1 Message Date
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