Commit Graph

200 Commits (3215e8535ae8afcf850fbaac9df7ff9abe42f9e0)

Author SHA1 Message Date
Dr. Stefan Schimanski 10cbaf7ce0 Store RequestInfo in Context
... in order to replace the manual RequestInfoResolver dependency injection
through out the code.
2016-09-28 18:51:34 +02:00
Dr. Stefan Schimanski 6dc2f6337b Separate apiserver handler filters 2016-09-27 09:57:59 +02:00
Dr. Stefan Schimanski 87356c0623 Cleanup handler chain 2016-09-23 12:03:58 +02:00
Dr. Stefan Schimanski 7f78661d0b Cleanup non-rest apiserver handlers
- rename MuxHelper -> PathRecorderMux
- move non-rest handlers into routes packages within genericapiserver and
  `pkg/routes` (those from master)
- move ui and logs handlers out of genericapiserver (they are
  not generic)
- make version handler configurable (`config.EnableVersion`)
2016-09-15 13:22:45 +02:00
PingWang 8760ae697e implement restful for InstallLogsSupport
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

add ws.doc

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

run hack/update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update update-swagger-spec.sh

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update apiserver_test.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update comment

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-16 09:09:02 +08:00
Chao Xu 4d2350632c only store typeMeta and objectMeta in the gc store 2016-08-08 17:23:13 -07:00
Ivan Shvedunov 02baa44948 Fix update validation for pods w/init containers. 2016-07-20 00:30:12 +03:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot ba771e7135 Merge pull request #27192 from smarterclayton/signature_change
Automatic merge from submit-queue

Remove EncodeToStream(..., []unversioned.GroupVersion)

Was not being used. Is a signature change and is necessary for post 1.3 work on Templates and other objects that nest objects.

Extracted from #26044
2016-06-19 16:13:07 -07:00
Clayton Coleman 36a5ffbe2f
Remove EncodeToStream(..., []unversioned.GroupVersion)
Was not being used.
2016-06-10 18:43:12 -04:00
Andy Goldstein e3af3451c8
ObjectMeta, ListMeta, and TypeMeta should implement their interfaces
Make unversioned.ListMeta implement List. Update all the *List types so they implement GetListMeta.
This helps avoid using reflection to get list information.

Remove all unnecessary boilerplate, move the interfaces to the right
places, and add a test that verifies that objects implement one, the
other, but never both.
2016-06-10 13:28:54 -04:00
Jordan Liggitt 29252acd1a Change rest storage Update interface to retrieve updated object
Add OldObject to admission attributes

Update resthandler Patch/Update admission plumbing
2016-05-23 21:09:26 -04:00
Clayton Coleman 88b39cadf8
Have the service account controller force retry
Service account controller, when API token not found, now sends 500 with
Retry-After: 1s. Also change the apiserver to actually write the error.
2016-05-19 09:08:57 -04: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
jianhuiz fdfe42ea44 move install of version handler to genericapiserver 2016-04-27 10:21:08 -07:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
Wojciech Tyczynski c0020aff59 Merge pull request #24539 from smarterclayton/unify_stream_and_serial
Unify Streaming and normal Serializers
2016-04-25 11:25:16 +02:00
k8s-merge-robot 0d4b039d87 Merge pull request #24474 from deads2k/fix-version-registration
Automatic merge from submit-queue

stop changing the root path of the root webservice

We shouldn't mutate the root path of the root webservice (see usage).  Just write the path we want.
2016-04-23 17:51:56 -07: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 58afaaafb1 Check for protobuf mimetype in apiserver 2016-04-20 12:13:10 -04:00
deads2k a79cb3c44e stop changing the root path of the root webservice 2016-04-19 13:08:46 -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
harry b0900bf0d4 Refactor diff into sub pkg 2016-03-21 20:21:39 +08:00
Madhusudan.C.S 8b7e56d242 Allow cross-group subresource registrations in the APIInstaller.
This allows subresources which belong to different API groups than
their parents to be registered in the APIInstaller and REST handlers
installed for them. The specific changes that makes this possible
are:

1. Allow subresource overrides to be specified while registering an
   API group.
2. Use those overrides in the APIInstaller while validating the
   resource/subresource group version to allow subresources which
   belong to a different group to be registered if they have an
   override specified.
3. Use the RESTMapper supplied in the override to map the REST paths
   to the correct subresource storage object, i.e. correct group
   version kinds.
2016-03-02 10:57:30 -08:00
deads2k 6d71421ae1 eliminate mixed case from RESTMapper 2016-02-08 15:33:31 -05:00
Wojciech Tyczynski f23034d5da Reset more metrics before scalability tests 2016-02-04 11:47:13 +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 c1d932e44a Switch API objects to not register per version codecs
Remove Codec from versionInterfaces in meta (RESTMapper is now agnostic
to codec and serialization). Register api/latest.Codecs as the codec
factory and use latest.Codecs.LegacyCodec(version) as an equvialent to
the previous codec.
2016-01-22 01:10:21 -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
Wojciech Tyczynski 58336829be Switch to versioned ListOptions in server. 2015-12-21 14:23:37 +01:00
deads2k 9fda7f1812 update StatusDetails to handle Groups 2015-12-17 09:14:12 -05:00
Brendan Burns 2efcccf981 Add a server side export facility 2015-12-16 15:01:13 -08:00
k8s-merge-robot e309583ff1 Merge pull request #18473 from smarterclayton/change_runtime_object
Auto commit by PR queue bot
2015-12-16 04:24:22 -08:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
deads2k 6e33403abf update CodecFor for GroupVersion 2015-12-15 10:56:00 -05:00
k8s-merge-robot 266ab4a796 Merge pull request #18487 from smarterclayton/guard_encode_decode
Auto commit by PR queue bot
2015-12-13 23:08:18 -08:00
k8s-merge-robot c458cd7bb7 Merge pull request #18379 from deads2k/gv-newobject
Auto commit by PR queue bot
2015-12-13 13:33:16 -08:00
deads2k ec87d74ecb update InterfacesFor to use GroupVersion 2015-12-11 13:45:41 -05: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
deads2k 519b4e80d1 update NewObject for groupversionkind 2015-12-09 08:13:15 -05:00
Daniel Martí 5ec087fa30 Properly close http connection on TestList
If not, using `go test -count=n` would make them pile up and ultimately
get to the limit of open files:

	apiserver_test.go:984: 17: unexpected error: Get http://127.0.0.1:44131/apis/test.group/version/simple: dial tcp 127.0.0.1:44131: socket: too many open files

Steps to reproduce (no longer fails):

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

Note that this might not fail if your `ulimit -n` is not low enough.
2015-12-05 13:29:03 +01:00
deads2k ed95a6d77f update scheme to use GroupVersion 2015-11-25 12:15:48 -05:00
deads2k 68b0572974 internal versions 2015-11-25 12:14:06 -05:00
k8s-merge-robot 3e56ce6490 Merge pull request #17327 from deads2k/gv-restmapper
Auto commit by PR queue bot
2015-11-24 19:08:49 -08:00
deads2k c40dd0335a make DefaultRESTMapper methods type correct 2015-11-24 14:17:37 -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
Jordan Liggitt b675a77213 Add groupless API server tests 2015-11-16 07:42:00 -05:00
deads2k bf983e942c use GroupVersion in APIGroupVersion for api installer 2015-11-16 07:42:00 -05:00