Commit Graph

79 Commits (e72c0428bd7c2e7db17a20bbe3d732215317c093)

Author SHA1 Message Date
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Tim Hockin 1c3233a1d4 Remove v1beta3 2015-07-23 17:21:27 -07:00
Daniel Smith bee68e48cd Have client store status code in Result 2015-06-23 18:48:01 -07:00
nikhiljindal 3d63c71cbc Removing legacyBehavior param from pkg/client 2015-06-15 16:49:11 -07:00
Clayton Coleman bdbf477207 REST Client metrics capture grows unbounded
The URLs were unique by namespace and query parameter value, which means
an infinite number of metrics counters could be created.
2015-06-15 11:03:20 -04:00
James DeFelice b5583db1d2 add UnversionedPath() to fix ServerAPIVersions() 2015-06-09 17:30:48 +00:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Clayton Coleman 53ca1fcc7a Expose URL() on Request to allow building URLs
The client/Request type is the appropriate place to build
URLs, this allows callers to generate URLs for providing to
others (such as SelfLinks or relative links to objects).
2015-04-29 23:27:13 -04:00
nikhiljindal dcc368c781 Removing more references to v1beta1 from pkg/ 2015-04-24 00:45:17 -07:00
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
deads2k dbda3f7303 make .Stream handle error status codes 2015-04-08 13:52:16 -04:00
Daniel Smith 44bc29631e compute query parameter names in the client. 2015-04-06 16:54:26 -07: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
Victor Marmol 2de37624e8 Merge pull request #6252 from krousey/string_format_cleanup
Fixing a lot of string formatting issues
2015-03-31 16:57:36 -07:00
Kris Rousey 6904c4d585 Fixing a lot of string formatting issues with regards to:
* Improper format specifier (e.g. %s for bools or %s for ints)
  * More or less parameters than format specifiers
  * Not calling a formatting function when it should have (e.g. Error() instead of Errorf())
2015-03-31 16:47:10 -07:00
Tim Hockin eeff1b74fb Fixes from feedback and testing 2015-03-30 23:52:37 -07:00
Tim Hockin 186818d787 WIP: Implement multi-port Services 2015-03-30 19:28:11 -07: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
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
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
Daniel Smith 244766ac89 Merge pull request #5002 from satnam6502/proxy-200
Do not fail status 200 responses to proxy calls
2015-03-06 10:20:07 -08:00
Daniel Smith 3ef3777192 Make unexported fields panic (informatively)
...Also fix some incorrect calls to semantic.DeepEqual, and a bug where
it returned true incorrectly.
2015-03-05 21:40:37 -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
derekwaynecarr 0bd0e12bbc Add support for Namespace as Kind
Add example for using namespaces
2015-02-10 09:50:50 -05:00
Yu-Ju Hong 4a72addaeb Factor out API defaulting from validation logic
Currently, the validation logic validates fields in an object and supply default
values wherever applies. This change factors out defaulting to a set of
defaulting callback functions for decoding (see #1502 for more discussion).

 * This change is based on pull request 2587.

 * Most defaulting has been migrated to defaults.go where the defaulting
   functions are added.

 * validation_test.go and converter_test.go have been adapted to not testing the
   default values.

 * Fixed all tests with that create invalid objects with the absence of
   defaulting logic.
2015-02-03 00:55:42 -08:00
nikhiljindal dc92d3c7a2 Cleaning up the operations code in client 2015-01-28 21:04:16 -08:00
nikhiljindal de60600608 Making all operations synchronous 2015-01-27 18:47:56 -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
Rohit Jnagal 62ecd5f3ff Fix few vet errors.
There are quite a few 'composite literal uses unkeyed fields' errors that I have kept out of this patch.
And there's a couple where vet just seems confused. These are the easiest ones.
2015-01-07 08:40:16 +00:00
Clayton Coleman e355f54eda Update references from Path() to the appropriate segment use 2014-12-29 15:38:52 -05:00
derekwaynecarr abb6632d75 Do not use namespace in url paths pre v1beta3 from client 2014-12-19 16:32:42 -05: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
Tim Hockin 95a9098311 fix 'go vet' warnings 2014-11-21 09:45:28 +08:00
markturansky bd7643c033 refactor services to v1beta3 2014-11-04 14:23:53 -05:00
Clayton Coleman 71fecef6f6 Add test coverage and fix a few minor problems 2014-10-29 14:08:37 -04:00
Clayton Coleman eac933eb44 Make client.Request more testable, break coupling with RESTClient
Moves polling to a function provided by the RESTClient, not innate
to Request. Moves doRequest from RESTClient to Request for clarity.
2014-10-28 23:00:24 -04:00
Clayton Coleman d5ee171410 Allow clients to determine the difference between create or update on PUT
PUT allows an object to be created (http 201).  This allows REST code to
indicate an object has been created and clients to react to it.

APIServer now deals with <-chan RESTResult instead of <-chan runtime.Object,
allowing more data to be passed through.
2014-10-24 14:41:15 -04:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Daniel Smith 6ef6ff5bc5 Merge pull request #1893 from crhym3/fix-1149-req-body
Replace custom ProxyServer (kubecfg/kubectl -proxy) with httputil.ReverseProxy
2014-10-22 15:29:59 -07:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
alex fb2b15a797 Replace custom proxy with httputil.ReverseProxy for kubecfg/kubectl.
Fixes #1149 - kubecfg proxy "411 Length Required" error on POST/PUT.
2014-10-21 18:52:18 +01:00
Clayton Coleman d3e51a0f24 Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
2014-10-07 11:12:16 -04:00
jhadvig d6b1fa8e02 Support for streaming 2014-10-02 14:45:16 +02:00