Commit Graph

35 Commits (0c669fe6cc48208ebcdd43fa2ff425fce3c359a0)

Author SHA1 Message Date
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
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
k8s-merge-robot 1e9edfc5c3 Merge pull request #29045 from lixiaobing10051267/mastererrNotAcceptable
Automatic merge from submit-queue

Type define note "errNotAcceptable" should be "errUnsupportedMediaType"

In file "pkg\apiserver\errors.go", line 129:
"// errNotAcceptable indicates Content-Type is not recognized"
Here "errNotAcceptable" shuould be "errUnsupportedMediaType", thus consistent with line 131:
"type errUnsupportedMediaType struct"
2016-07-19 01:10:41 -07:00
Michal Rostecki fa0dd46ab7 Return (bool, error) in Authorizer.Authorize()
Before this change, Authorize() method was just returning an error,
regardless of whether the user is unauthorized or whether there
is some other unrelated error. Returning boolean with information
about user authorization and error (which should be unrelated to
the authorization) separately will make it easier to debug.

Fixes #27974
2016-07-18 12:06:54 +02:00
lixiaobing10051267 7ecae85493 Type define note "errNotAcceptable indicates Content-Type is not recognized" wrong 2016-07-16 11:31:52 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08: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
Timothy St. Clair a428246960 Abstract the error handling for the storage layer to eliminate the
direct etcd dependency.
2015-12-10 08:06:19 -06:00
Clayton Coleman 1d592e4c28 Unversioned types should not use ambiguous go-int
All external types that are not int64 are now marked as int32,
including
IntOrString. Prober is now int32 (43 years should be enough of an initial
probe time for anyone).

Did not change the metadata fields for now.
2015-11-26 11:45:25 -05:00
Tim St. Clair 20ead45af9 Move etcd_util.go to separate package 2015-11-23 11:32:50 -08:00
deads2k 6fbb3f4b6e add nonResourceURL detection 2015-10-20 16:23:30 -04:00
deads2k dc8d0de70b update APIRequestInfo for APIGroup 2015-09-30 09:45:10 -04:00
Kris f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Wojciech Tyczynski 3cbbe72f9f Move etcd storage to pkg/storage/etcd 2015-07-30 15:42:06 +02:00
Brian Grant 55529d9256 Merge pull request #7153 from xiang90/apiserver
minor cleanup for apiserver/errors.go
2015-06-02 10:37:36 -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
Xiang Li fb3c8f9452 pkg/apiserver: minor cleanup for errToAPIStatus() 2015-04-22 10:44:03 -07:00
Clayton Coleman d167c11b59 Remove layers of indirection between apiinstaller and resthandler
Make the RESTHandler feel more go-restful, set the stage for adding
new types of subresource collections.
2015-02-11 16:26:06 -05:00
Clayton Coleman 19987612bf Replace code that eats errors with a more consistent reporting
In order to allow certain programmer error / unexpected error states
to be captured, replace sections that log and eat errors with a method
that can be centrally replaced.  This captures two common error sources,
replication errors, and apiserver code that returns invalid errors.
2015-01-26 20:54:29 -05:00
Eric Tune 26a2bab797 Add forbidden error.
Will be used in subsequent PRs that add authorization.
2014-10-16 09:25:54 -07:00
Clayton Coleman 74db9a1b20 Log apiserver errors that are not of an expected type
Currently HttpLog only expected status range - this logs errors
that come back from a REST storage object without being first
converted to something in pkg/api/errors.  This usually indicates
unexpected error conditions that a programmer didn't explicitly
check for - the kinds of problems that may need debugging by
an operator later.  Set to V(1) because they don't impair normal
operation.
2014-09-25 16:21:48 -04:00
Clayton Coleman 34c40e4e48 Errors should be part of api/errors, not apiserver
Renames constructor methods to be errors.New<name> which changed a few
places.
2014-09-03 17:16:00 -04:00
Vojtech Vitek (V-Teq) 59f58cd043 Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:03 +02:00
Clayton Coleman 0a841a49fd Naming of Reason constants is inconsistent
Changed ReasonType to StatusReason (to match the field) and
changed CauseReason to CauseType and renamed StatusCause.Reason to
Type.
2014-08-26 13:39:21 -04:00
Clayton Coleman 52923a1348 Return validation errors from storage create/update 2014-08-26 13:30:55 -04:00
Clayton Coleman d326ba2976 Add a Causes array to status details for validation errors
Uses the same constant values as api/errors for each nested
reason.
2014-08-26 13:30:55 -04:00
Clayton Coleman 0083fae453 Provide helpers and tests for common error types
Unify error handling in apiserver into a single path - RESTStorage
objects must provide appropriate errors individually.  Ensure ALL
errors which can be traced to logical faults with RESTStorage are
returned as api.Status objects.
2014-08-08 19:44:47 -04:00
Clayton Coleman 836d2b9808 Fix proxy error condition and simplify method
Add new minion proxy test case.
2014-08-06 01:03:17 -04:00
Clayton Coleman 325f9ef005 Make create atomic on etcd for Services/ReplControllers 2014-08-05 01:12:27 -04:00
Clayton Coleman fe7f611d88 Split operations code and add comments 2014-07-30 17:15:09 -04:00
Clayton Coleman a2c86e4c97 Simplify helpers 2014-07-30 17:15:09 -04:00
Clayton Coleman d5e22bfe2a Split index 2014-07-30 17:14:07 -04:00