Commit Graph

45 Commits (ab7d039c81a2dcf35b83ce7e4a35151ae2e176fc)

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
k8s-merge-robot ae990defcf Merge pull request #26956 from joe2far/fix-typos
Automatic merge from submit-queue

Fixed several typos
2016-07-14 04:13:15 -07: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
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
k8s-merge-robot 01c0f8cb54 Merge pull request #28587 from wojtek-t/remove_codec_from_content_config
Automatic merge from submit-queue

Remove Codec from ContentConfig.

This is the remaining cleanup after adding NegotiatedSerializer to ContentConfig.
2016-07-08 21:12:24 -07:00
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
k8s-merge-robot b3c2c9eb5d Merge pull request #27381 from dims/fix-issue-2967
Automatic merge from submit-queue

Fix problem specifying fqdn:port in command line

When specifying --server in kubectl for example, we end up
with failure if you use "localhost:8080" instead of
"127.0.0.1:8080". This is because of the way url.Parse
works as shown in snippet:
https://play.golang.org/p/luD57S6sEz

Essentially localhost ends up as the Scheme and NOT as the Host.
So we add another check to make sure we prepend the scheme
when Host ends up being empty as well. Tested with
"kubectl --server localhost:8080 get po"

Fixes #2967
2016-07-07 13:21:58 -07:00
k8s-merge-robot bb763df8d5 Merge pull request #28530 from lixiaobing10051267/msterwascreated
Automatic merge from submit-queue

"was not created" should be "was created"

In file pkg\client\restclient/request_test.go, line #1089, "t.Errorf("expected object was not created")" , here "was not created" should be "was created" because the if condition is "if wasCreated".
2016-07-06 23:37:02 -07:00
lixiaobing10051267 10a26ab158 "was not created" should be "was created" 2016-07-06 17:42:40 +08:00
Davanum Srinivas 0d86251f5f
Fix problem specifying fqdn:port in command line
When specifying --server in kubectl for example, we end up
with failure if you use "localhost:8080" instead of
"127.0.0.1:8080". This is because of the way url.Parse
works as shown in snippet:
https://play.golang.org/p/luD57S6sEz

Essentially localhost ends up as the Scheme and NOT as the Host.
So we add another check to make sure we prepend the scheme
when Host ends up being empty as well. Tested with
"kubectl --server localhost:8080 get po"

Fixes #2967
2016-07-05 10:10:12 -04:00
bin liu 426fdc431a Merge branch 'master' into fix-typos 2016-07-04 11:20:47 +08:00
k8s-merge-robot f2ddd60eb9 Merge pull request #26755 from david-mcmahon/fix-headers
Automatic merge from submit-queue

Remove "All rights reserved" from all the headers.

cc @thockin @zmerlynn @brendanburns
2016-06-29 18:46:07 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Hongchao Deng 55d3597456 change default value of QPS and burst to constant 2016-06-28 21:45:35 -07:00
Hongchao Deng ca17e4745f docs: client default config of qps and burst 2016-06-28 21:45:35 -07:00
k8s-merge-robot 31804fb971 Merge pull request #26857 from rajdeepd/client_test
Automatic merge from submit-queue

Test cases for Rest Client
2016-06-27 22:06:40 -07:00
bin liu fd27cd47f7 fix some typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 18:14:26 +08:00
Rajdeep Dua 27b6c1b4f8 Test cases for Rest Client 2016-06-16 02:14:19 -07:00
Wojciech Tyczynski 528713bcc2 Fix Retry-After in clients 2016-06-07 21:04:44 +02: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 2706df102b Merge pull request #25465 from wojtek-t/client_renegotiation
Support renegotiation in client based on response ContentType
2016-05-12 10:21:10 +02:00
Wojciech Tyczynski e48116bb75 Client renegotiation 2016-05-12 08:21:11 +02:00
Ed Robinson afdbad078a
Corrects some misspellings in comments
This should help to make
https://goreportcard.com/report/k8s.io/kubernetes#misspell
look a little nicer.
2016-05-11 08:16:13 +01:00
Wojciech Tyczynski 1ea0d46bb3 Set headers in Watch() and Stream() requests 2016-05-09 09:33:13 +02:00
Wojciech Tyczynski ac5d2cec44 Test if headers are set 2016-05-09 09:31:49 +02:00
CJ Cullen 13a7d92d0f Add a ConfigPersister for AuthProvider plugins in kubectl/clients. 2016-05-07 18:15:18 -07: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
Wojciech Tyczynski b4c83022e3 Add NegotiatedSerializer to config 2016-05-04 10:02:58 +02:00
k8s-merge-robot d0b887e4e0 Merge pull request #24595 from zhouhaibing089/httpserverclose
Automatic merge from submit-queue

Uncomment the code that caused by #19254

Fix https://github.com/kubernetes/kubernetes/issues/24546.

@lavalamp
2016-04-28 01:41:16 -07:00
gmarek 3171aac57c Generated clients can return their RESTClients, RESTClient can return its RateLimiter 2016-04-27 22:15:10 +02:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
k8s-merge-robot 495251b983 Merge pull request #24166 from gmarek/client
Automatic merge from submit-queue

All clients under ClientSet share one RateLimiter.

Currently we create a rate limiter for each client in client set. It makes the reasoning about rate limiting behavior much harder. This PR changes this behavior and now all clients in the set share single rate limiter. Ref. #24157

cc @lavalamp @wojtek-t
2016-04-21 22:31:23 -07:00
gmarek b76bed0cc9 All clients under ClientSet share one RateLimiter. 2016-04-21 18:48:22 +02:00
CJ Cullen 03f9b5adc0 Add client auth plugin framework for kubectl with GCP auth plugin. 2016-04-14 17:49:16 -07:00
deads2k ac4c545b91 add act-as powers 2016-04-14 12:49:10 -04:00
harry 5fe773d37c Add flow control pkg
Refactor pkg names in flow control related files
2016-04-03 11:28:03 +08:00
Brendan Burns be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
harry 8472cfa214 Refactor throttle into util pkg
Fix missing throttle.go
2016-03-25 08:32:23 +08:00
harry b0900bf0d4 Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
Harry Zhang a4d04095d0 Refactor crlf & crypto 2016-03-21 20:20:05 +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