Commit Graph

39 Commits (458eb5284abd6933c620ba8ea383032f225e0885)

Author SHA1 Message Date
Clayton Coleman 38c7eded99 Prepare for content-type negotiation
Combine the fields that will be used for content transformation
(content-type, codec, and group version) into a single struct in client,
and then pass that struct into the rest client and request. Set the
content-type when sending requests to the server, and accept the content
type as primary.

Will form the foundation for content-negotiation via the client.
2016-01-26 17:44:30 -05:00
Clayton Coleman efe88e0818 Update client library to react to changes in Decoding 2016-01-22 13:27:24 -05:00
k8s-merge-robot 03ecde1277 Merge pull request #17535 from mesosphere/jdef_abspath_breaks_proxies
Auto commit by PR queue bot
2016-01-20 21:46:47 -08:00
James DeFelice 75f487f7bf AbsPath should be compatible with proxy-prefixes:
- replace Config.Prefix with .Host and .APIPath
- Request .path promoted to .pathPrefix, .baseURL holds required prefix
2016-01-20 00:31:58 +00:00
harry 98222b4d8b Replace to tag
Use a testing pkg to replace testing util codes
2016-01-15 15:07:21 +08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Daniel Martí 5505706891 Properly close tmp files in unversioned
If not, using `go test -count=n` would make them pile up and ultimately
get to the limit of open files:

	2015/12/05 12:43:56 http: Accept error: accept tcp 127.0.0.1:39768: accept4: too many open files; retrying in 5ms
	2015/12/05 12:43:56 http: Accept error: accept tcp 127.0.0.1:46606: accept4: too many open files; retrying in 5ms
	2015/12/05 12:43:56 http: Accept error: accept tcp 127.0.0.1:46606: accept4: too many open files; retrying in 10ms
	2015/12/05 12:43:56 http: Accept error: accept tcp 127.0.0.1:46606: accept4: too many open files; retrying in 20ms

Steps to reproduce (no longer fails):

	godep go test -short -run '^$' -o test .
	./test -test.run '^TestDoRequestNewWayFile$' -test.count 100

Note that this might not fail if your `ulimit -n` is not low enough.
2016-01-06 12:55:42 +01:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
k8s-merge-robot 414ebd2ddb Merge pull request #17991 from krousey/errorstatus
Auto commit by PR queue bot
2015-12-14 20:18:19 -08:00
k8s-merge-robot 29e8b6123f Merge pull request #17529 from jayunit100/hammer-backoff-expo-part2
Auto commit by PR queue bot
2015-12-14 19:48:40 -08:00
Wojciech Tyczynski 960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
Kris ca7c765f0a Remove APIStatus from the client
Everything that used it also depended on pkg/api/errors. It was a
needless abstraction since it was always an *errors.StatusError.
2015-12-10 13:12:21 -08:00
Jay Vyas 76e6281168 Exponential backoff for request client, rebased. Updated license to
2015, cleaned more //[a-z] comments. Added in support for Environment
variable gaurds over the backcoff w/ default NoBackoff. Rebased.
2015-12-07 20:19:51 -05:00
deads2k 2ee3dfe415 update testapi to eliminate redundant fields 2015-12-07 15:54:26 -05:00
deads2k 0fd17b7b2e update client.Request for GroupVersion 2015-12-03 08:16:41 -05:00
Wojciech Tyczynski cdded4f011 Use VersionedParams in "extensions" client. 2015-12-01 10:18:55 +01:00
Clayton Coleman 9d19238f6c Fix tests to pass with changed external types 2015-11-26 11:53:37 -05:00
Wojciech Tyczynski b6ef62af24 Use unversioned.ListOptions in clients. 2015-11-24 16:52:09 +01:00
deads2k a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
Kris 7f6d2e8305 Cleaning up client request unit tests
1. Closing test servers that we open.
2. Remove dependency on Config and just call NewRESTClient directly
3. Remove auth tests as they are redundant to the tests in transport_test.go
2015-11-20 08:52:34 -08:00
Tim Hockin ba383bcfeb Refactor IntOrString into a new pkg
pkg/util/intstr is a cleaner encapsulation for this type and supporting
functions.  No behavioral change.
2015-11-16 10:57:52 -08:00
Kris 0a4ee958c7 Use http's basic auth instead of manual encoding 2015-11-06 10:19:01 -08:00
k8s-merge-robot c7d5f3cdca Merge pull request #16881 from krousey/client_path
Auto commit by PR queue bot
2015-11-06 01:11:21 -08:00
k8s-merge-robot 6b7115067d Merge pull request #16807 from smarterclayton/server_backpressure_on_etcd_down
Auto commit by PR queue bot
2015-11-05 21:19:30 -08:00
Kris 9e1afbceb0 Remove bad heuristic path manipulation 2015-11-05 14:42:36 -08:00
Clayton Coleman 3da15535b6 Provide backpressure to clients when etcd goes down
When etcd is down today we don't specifically handle the error involved,
which means clients get a generic 500 error. This commit adds a formal
error type internally for both WatchExpired and EtcdUnreachable, and
then converts them to api/errors before returning to the client. It also
upgrades the client to retry on any 429 or 5xx error that has a
Retry-After header, instead of just 429.

In combination, this allows the apiserver to exert backpressure on
controllers that are hotlooping.  Picked 2 seconds by default, but we
could potentially ramp that up even further in a future iteration.
2015-11-04 16:05:12 -05:00
Jordan Liggitt b3157d1445 Ensure HPA has valid resource/name/subresource, validate path segments 2015-11-03 14:46:17 -05:00
Wojciech Tyczynski 579fa74977 Add test for TimeoutSeconds parameter 2015-10-28 15:48:36 +01:00
Daniel Smith 424afd4cfb Merge pull request #15971 from jlowdermilk/client-http-content-type
Set Content-Type in headers of client http requests
2015-10-27 15:33:32 -07:00
Wojciech Tyczynski f4d75e0a0a Support timeout in watch requests 2015-10-24 13:12:49 +02:00
Jeff Lowdermilk 583246a22f Set Content-Type in client http request header when posting objects 2015-10-22 13:50:28 -07:00
Wojciech Tyczynski 433ccf0043 Fix broken Request test 2015-10-21 11:09:29 +02:00
Chao Xu 50a2c4c643 grep-sed 2015-10-12 13:31:45 -07:00
Clayton Coleman 3f1b18fbba Refactor exec to make attach useful without a client.Config
The current executor structure is too dependent on client.Request
and client.Config. In order to do an attach from the server, it needs
to be possible to create an Executor from crypto/tls#TLSConfig and to
bypassing having a client.Request.

Changes:

* remotecommand.spdyExecutor - handles upgrading a request to SPDY and getting a connection
* remotecommand.NewAttach / New - moved to exec / portforward / attach since they handle requests
* Remove request.Upgrade() - it's too coupled to SPDY, and can live with the spdyExecutor
* Add request.VersionedParams(runtime.Object, runtime.ObjectConvertor) to handle object -> query transform
2015-10-09 14:36:46 -04:00
Kris f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07:00
Chao Xu 64bf839e9f refactor tests to use testapi rather than latest directly 2015-09-11 17:32:23 -07:00
Chao Xu dd6c121d7f massive changes 2015-09-11 17:31:47 -07:00
Chao Xu 9fc79e9d99 refactor testapi and test scripts to prepare for multiple API groups. 2015-09-04 18:01:32 -07:00
Kris Rousey 7ba5b058cc Moving client libs to unversioned dir 2015-08-18 10:03:19 -07:00