Commit Graph

90 Commits (6cfce2c7ee2008a64048e39ceac17db60d93040f)

Author SHA1 Message Date
Clayton Coleman 852ef7b637 Reorganized Request.DoRaw() to guarantee streams are closed
Added a test to verify 429 triggers a client retry based on
header. Forced resp.Body.Close() to close after each request,
which allows Golang to reuse the TCP connection to the server
(should reduce connection establishment under retries).
Possibly fixed a server leak of request bodies.
2015-04-10 01:10:35 -04:00
Daniel Smith 43ec88fda5 Merge pull request #6179 from bprashanth/ts_ttl_scheduler
Modeler uses a ttl store for assumed pods
2015-04-08 15:25:05 -07:00
Prashanth Balasubramanian a7864aa230 Scheduler uses TTLStore for assumed pods 2015-04-08 15:01:04 -07:00
deads2k dbda3f7303 make .Stream handle error status codes 2015-04-08 13:52:16 -04:00
Daniel Smith c1390a0836 version field selector field names in the client 2015-04-07 16:59:57 -07:00
Daniel Smith 44bc29631e compute query parameter names in the client. 2015-04-06 16:54:26 -07:00
Yu-Ju Hong dbd7b186a0 Merge pull request #6338 from smarterclayton/improve_config_error
Return a typed error for config validation, and make errors simple
2015-04-03 18:08:15 -07:00
Brian Grant 0d95883593 Merge pull request #6027 from ghodss/kube-patch
Implement Strategic Merge Patch in apiserver
2015-04-03 15:08:51 -07:00
Sam Ghods 2c977db1b3 Implement Strategic Merge Patch in apiserver 2015-04-03 11:51:02 -07:00
Filip Grzadkowski 4c50767c80 Add metrics to REST client 2015-04-03 14:42:06 +02:00
Clayton Coleman 323a44e54a Make kubectl errors even more user-friendly
Omit glog prefix when v < 2, show multiline errors for configuration
problems, add new generic messages for server errors that hide some
complexity that is not relevant for users.
2015-04-02 01:40:15 -04:00
Clayton Coleman aa44d29d10 Updated documentation and adjusted field names 2015-03-27 17:08:59 -04:00
Clayton Coleman 524f8731b5 Decode errors returned to clients by the Watch interface 2015-03-26 17:30:13 -04:00
Clayton Coleman 30358e8b04 Add more specific error handling and handle generic errors more effectively
The client library should type more generic errors from the server.
2015-03-26 17:30:13 -04:00
Clayton Coleman b1ab14315b Clients should not check conditions, UpdateStatus() is inconsistent
Corrects some of the cargo culting that has crept into the API.
2015-03-25 16:25:04 -04:00
Brian Grant 11f9733599 Merge pull request #5587 from nikhiljindal/enable3
Updating integration tests to test both API versions - v1beta1 and 3
2015-03-18 16:14:20 -07:00
nikhiljindal 7e36bbab3c Updating integration tests to test both API versions - v1beta1 and 3 2015-03-18 15:24:11 -07:00
Salvatore Dario Minonne 31ddefc347 Finalize fields.Selector 2015-03-17 22:55:43 +01:00
Brendan Burns 266234f3b9 Make label and field selector query strings versionable. 2015-03-12 12:24:07 -07:00
Salvatore Dario Minonne 925fa6baf8 Adding fields selector 2015-03-10 22:13:10 +01:00
Brian Grant 7b72d9539f Merge pull request #5054 from smarterclayton/switch_to_sub_bindings
Make Pod binding a subresource (and be generic to other types)
2015-03-09 16:41:26 -07:00
Clayton Coleman 227a1d306d Support SubResource call on Request
Allows better semantic use of Request when dealing with sub resources,
and allows clients to ignore ordering.  Supports multiple segments because
sub-resources are less tightly structured than regular resources.
2015-03-09 14:39:31 -04:00
Brendan Burns f505a33998 Differentiate between server error messages and client error messages in kubectl 2015-03-07 11:39:23 +01:00
Satnam Singh cb4c931b0b Do not fail status 200 responses to proxy calls 2015-03-06 00:29:19 -08:00
Satnam Singh 61e38920a5 Do not fail status 200 responses to proxy calls 2015-03-05 16:19:13 -08:00
Salvatore Dario Minonne 75f2efb500 moving ParseSelector to Parse for labels only. 2015-03-05 22:39:36 +01:00
Andy Goldstein 5bd0e9ab05 Add streaming command execution & port forwarding
Add streaming command execution & port forwarding via HTTP connection
upgrades (currently using SPDY).
2015-02-20 09:57:02 -05:00
Clayton Coleman 7e07d711b8 Provide a helper on client/request.go for full URI
Allows self links to be directly passed
2015-02-16 16:31:32 -05:00
Clayton Coleman 3e2e4714a2 Always set ?namespace in query if specified
Revise our code to only call Request.Namespace() if a namespace
*should* be present.  For root scoped resources, namespace should
be ignored.  For namespaced resources, it is an error to have
Namespace=="".
2015-02-16 00:23:38 -05:00
derekwaynecarr 0bd0e12bbc Add support for Namespace as Kind
Add example for using namespaces
2015-02-10 09:50:50 -05:00
nikhiljindal dc92d3c7a2 Cleaning up the operations code in client 2015-01-28 21:04:16 -08:00
Clayton Coleman 5117189e03 Merge pull request #3707 from nikhiljindal/preOperations
Removing support for asynchronous server requests
2015-01-28 13:02:52 -05:00
nikhiljindal de60600608 Making all operations synchronous 2015-01-27 18:47:56 -08:00
Satnam Singh 3a9e6d8f29 Switch to use Too Many Requests response code
Name the 429 status code
2015-01-27 14:54:30 -08:00
Satnam Singh 8350bb9700 Add a Retry-After header when rate limit is exceeded 2015-01-22 16:03:00 -08:00
Clayton Coleman 8f65442c2f Client should not include ns/ for non-namespaced calls in v1beta3 2015-01-08 12:44:07 -05:00
Clayton Coleman b03fbf90f8 Make RESTClient more generic to API version, simplify version handling
RESTClient is an abstraction on top of arbitrary HTTP endpoints that
follow the Kubernetes API conventions. Refactored RESTClientFor so that
assumptions that are Kube specific happen outside of that method (so
others can reuse the RESTClient). Added more validation to client.New
to ensure clients give good input. Exposed APIVersion on RESTClient
as a method so that wrapper code (code that adds typed / structured
methods over rest endpoints like client.Client) can more easily make
decisions about what APIVersion it is running under.
2015-01-07 18:03:34 -05:00
Daniel Smith 9c2cd55528 Merge pull request #3181 from smarterclayton/cleanup_http_items
Minor cleanups to request - fix initialism on HTTPClientFunc
2014-12-30 17:34:00 -08:00
Clayton Coleman 502204ad6d Do not set empty field or label selectors on requests
Default behavior for "" is already "everything"
2014-12-30 19:33:40 -05:00
Clayton Coleman afedbba3fc Introduce Resource/ResourceName/Prefix/Suffix options to RESTClient
RESTClient is an abstraction for simplifying access to resources that
follow the Kubernetes API pattern.  Currently, both Namespace and Path
are coupled, which means changes across versions is complex.  In general,
most access to resources should be to a resource collection (e.g.
"services") with a name (e.g. "foo"). Other constructs, like prefix sections
("watch") or proposed suffix sections ("/pods/foo/spec") only modify this
core pattern.

This commit removes the Path() helper from Request and introduces:

* Prefix(segments ...string) - segments that should go to the beginning of the path.
* Suffix(segments ...string) - segments that should go to the end of the path.
* Resource(string) - collection name, should be after prefix
* Namespace(string) - if specified, should be set after resource but before name
* Name(string) - if specified, should be after namespace

Now, only Prefix and Suffix are order dependent (and with variadics, should be
simpler).  Resource, Namespace, and Name may be specified in any order.

Path() has been removed to prevent downstream consumers of RESTClient from experiencing
behavior change.
2014-12-29 15:37:30 -05:00
derekwaynecarr 652b7aa665 Rename namespaceAsPath 2014-12-22 12:24:21 -05:00
Daniel Smith 36cfc02c6c Merge pull request #3066 from derekwaynecarr/client_update
Do not use namespace in url paths pre v1beta3 from client
2014-12-19 18:02:55 -08:00
derekwaynecarr abb6632d75 Do not use namespace in url paths pre v1beta3 from client 2014-12-19 16:32:42 -05:00
Daniel Smith be9f3be709 better logging 2014-12-19 12:28:51 -08:00
Daniel Smith a50f8034c8 Merge pull request #3037 from smarterclayton/hide_spurious_watch_errors
When connections are broken on Watch, write fewer errors to logs
2014-12-18 13:33:03 -08:00
Daniel Smith 3ade280f89 Merge pull request #2813 from derekwaynecarr/ns_url
Move namespace from query param to path part
2014-12-18 13:31:45 -08:00
Clayton Coleman b2434de777 When connections are broken on Watch, write fewer errors to logs
Watch depends on long running connections, which intervening proxies
may break without the control of the remote server. Specific errors
handled are io.EOF, io.EOF wrapped by *url.Error, http connection
reset errors (caused by race conditions in golang http code), and
connection reset by peer (simply tolerated).
2014-12-18 16:15:51 -05:00
Salvatore Dario MINONNE 61ac2f7437 kubectl delete command: adding labelSelector
Add a Visitor pattern on top of ResourcesFromArgs

Allows ResourcesFromArgs to return an opaque list of items and have client
commands react to them.

Change request.go to return apiserver errors for arbitrary status codes to
better respond to generic actions that don't make sense (kubectl delete operations foo)
2014-12-17 18:15:03 +00:00
derekwaynecarr 7cf664439f Move namespace from query param to path part 2014-12-16 15:55:47 -05:00
Tim Hockin ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00