Commit Graph

61 Commits

Author SHA1 Message Date
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Clayton Coleman
159797bac4
Watch benchmark should skip init containers for now 2016-05-21 23:55:40 -04: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
k8s-merge-robot
c0fca43260 Merge pull request #24915 from wojtek-t/read_closer_in_streaming_decoder
Automatic merge from submit-queue

Support Close() in streaming decoder

[This would be useful for changes in clients to support protobufs.]
2016-04-29 07:21:23 -07:00
Wojciech Tyczynski
3175d18b14 Support Close() in streaming decoder 2016-04-28 09:46:33 +02:00
zhouhaibing089
bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
Clayton Coleman
3111985564 Handle streaming serializers more consistently
Add tests to watch behavior in both protocols (http and websocket)
against all 3 media types. Adopt the
`application/vnd.kubernetes.protobuf;stream=watch` media type for the
content that comes back from a watch call so that it can be
distinguished from a Status result.
2016-04-22 11:07:24 -04:00
Clayton Coleman
3474911736 Implement a streaming serializer for watch
Changeover watch to use streaming serialization. Properly version the
watch objects. Implement simple framing for JSON and Protobuf (but not
YAML).
2016-04-11 11:22:05 -04:00
Jan Chaloupka
4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
Clayton Coleman
443cafab90 Add benchmarks for watch over websocket and http
... and a quick doc on how to run them

```
$ godep go test ./pkg/apiserver -benchmem -run=XXX -bench=BenchmarkWatch
PASS
BenchmarkWatchHTTP-8        20000     95669 ns/op   15053 B/op    196 allocs/op
BenchmarkWatchWebsocket-8   10000    102871 ns/op   18430 B/op    204 allocs/op
```
2016-01-28 21:34:51 -05:00
Clayton Coleman
125ef6fbc8 Support content-type negotiation in the API server
A NegotiatedSerializer is passed into the API installer (and
ParameterCodec, which abstracts conversion of query params) that can be
used to negotiate client/server request/response serialization. All
error paths are now negotiation aware, and are at least minimally
version aware.

Watch is specially coded to only allow application/json - a follow up
change will convert it to use negotiation.

Ensure the swagger scheme will include supported serializations - this
now includes application/yaml as a negotiated option.
2016-01-22 00:12:50 -05: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
Clayton Coleman
1e21054134 Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of
Encode and Decode to be more complicated. Create a stub helper
with the exact semantics of today and do the simple mechanical
refactor here to reduce the cost of that change.
2015-12-09 21:15:02 -05:00
Wojciech Tyczynski
bf13bef955 Use unversioned.ListOptions in API server. 2015-11-24 14:42:21 +01:00
deads2k
303bcad398 use groupversion in RESTMapping 2015-11-16 09:22:11 -05:00
deads2k
bf983e942c use GroupVersion in APIGroupVersion for api installer 2015-11-16 07:42:00 -05:00
David Eads
486103d887 Revert "use GroupVersion in APIGroupVersion for api installer" 2015-11-13 12:55:08 -05:00
deads2k
3c725f17ea use GroupVersion in APIGroupVersion for api installer 2015-11-13 09:00:04 -05:00
Wojciech Tyczynski
3d88a63b5d Refactor test objects to a separate package 2015-10-13 10:15:11 +02:00
Brendan Burns
77fd388485 Increase a bunch of timeouts to reduce flakes 2015-09-23 11:09:03 -07:00
Kris
f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07:00
Mike Danese
17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese
8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Jordan Liggitt
a341b8f44f Remove ?namespace= param handling/defaulting 2015-06-16 22:40:01 -04:00
Kris
f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Prashanth Balasubramanian
8a5445d3db Randomize apiserver watch timeouts 2015-05-21 20:52:33 -07: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
870da687d0 Add more extensive tests to apiserver for variations in version
Formalize v1beta1 and v1beta3 style APIs in our test cases.
2015-03-27 15:03:58 -04:00
Clayton Coleman
eb0eff69fe Move watch to being a resthandler resource and expose it on LIST
GET /pods?watch=true&resourceVersion=10

will now function equivalent to GET /watch/pods.
2015-03-27 15:03:58 -04:00
Clayton Coleman
1618c39a46 Convert List query parameters via object conversion
Convert url.Values -> an object, with appropriate versioning. ListOptions
should also expose parameter names to swagger.
2015-03-27 15:03:57 -04:00
Clayton Coleman
d46087db50 Move REST* interfaces into pkg/api/rest
Dependency chain is now api -> api/rest -> apiserver.  Makes the
interfaces much cleaner to read, and cleans up some inconsistenties
that crept in along the way.
2015-03-23 16:52:21 -04: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
Clayton Coleman
4b16a87096 Simplify api_installer and setup methods 2015-03-09 14:39:31 -04:00
Daniel Smith
c4822dc060 Revert "Revert "Adding converter functions to convert field label selectors to internal version before matching""
This reverts commit 5f35a67002.
2015-03-02 15:00:09 -08:00
Zach Loafman
5f35a67002 Revert "Adding converter functions to convert field label selectors to internal version before matching" 2015-02-28 11:42:49 -08:00
nikhiljindal
48e7945f65 Versioning the field selectors 2015-02-27 16:10:59 -08:00
Jordan Liggitt
083ce268e0 Put user in context, map requests to context above resthandler layer 2015-02-12 20:58:04 -05:00
derekwaynecarr
4c33e36a88 Plumb restmapper properly through apiserver and tests 2015-02-02 10:26:19 -05:00
derekwaynecarr
1e2b995a79 Fix admission control in tests 2015-01-07 14:42:31 -05:00
derekwaynecarr
520ae3ef27 Implement basic admission control framework 2015-01-07 14:42:31 -05:00
Sam Ghods
6399854240 Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
2014-12-02 16:25:28 -08:00
Eric Paris
4e95104953 update code.goole.com/p/go.net to golang.org/x/net
https://groups.google.com/forum/#!topic/golang-nuts/eD8dh3T9yyA
2014-11-16 22:10:24 -05:00
Brian Grant
7583e1a643 Automatic API generation by adopting go-restful 2014-11-14 16:49:19 +00:00
Daniel Smith
4196780eda Add self links to objects sent down the watch channel. 2014-11-05 17:22:18 -08:00
Deyuan Deng
acf9d23b32 Stop httptest server. 2014-10-30 21:37:08 -04:00
derekwaynecarr
dda19071e3 Fix watch by namespace 2014-10-30 12:56:50 -04:00
Clayton Coleman
bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Clayton Coleman
82bcdd3b3b Make ResourceVersion a string internally instead of uint64
Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.

This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.
2014-10-07 19:00:26 -04:00
Daniel Smith
37e505601e add self linking to apiserver 2014-09-26 15:08:02 -07:00