Commit Graph

711 Commits (860050b507490f664bc4710a262f574d454d842e)

Author SHA1 Message Date
Daniel Smith 860050b507 Merge pull request #745 from smarterclayton/add_structured_reason
Evolve the api.Status object with Reason/Details
2014-08-05 13:28:19 -07:00
Clayton Coleman 4f88b778a6 Evolve the api.Status object with Reason/Details
Contains breaking API change on api.Status#Details (type change)

Turn Details from string -> StatusDetails - a general
bucket for keyed error behavior.  Define an open enumeration
ReasonType exposed as Reason on the status object to provide
machine readable subcategorization beyond HTTP Status Code. Define
a human readable field Message which is common convention (previously
this was joined into Details).

Precedence order: HTTP Status Code, Reason, Details. apiserver would
impose restraints on the ReasonTypes defined by the main apiobject,
and ensure their use is consistent.

There are four long term scenarios this change supports:

1. Allow a client access to a machine readable field that can be
   easily switched on for improving or translating the generic
   server Message.

2. Return a 404 when a composite operation on multiple resources
   fails with enough data so that a client can distinguish which
   item does not exist.  E.g. resource Parent and resource Child,
   POST /parents/1/children to create a new Child, but /parents/1
   is deleted.  POST returns 404, ReasonTypeNotFound, and
   Details.ID = "1", Details.Kind = "parent"

3. Allow a client to receive validation data that is keyed by
   attribute for building user facing UIs around field submission.
   Validation is usually expressed as map[string][]string, but
   that type is less appropriate for many other uses.

4. Allow specific API errors to return more granular failure status
   for specific operations.  An example might be a minion proxy,
   where the operation that failed may be both proxying OR the
   minion itself.  In this case a reason may be defined "proxy_failed"
   corresponding to 502, where the Details field may be extended
   to contain a nested error object.

At this time only ID and Kind are exposed
2014-08-05 16:17:53 -04:00
Daniel Smith dc0a475be9 Merge pull request #796 from nyaxt/fixrace
Avoid data race in Proxier.OnUpdate
2014-08-05 12:56:05 -07:00
Kouhei Ueno 2e02967aca Avoid data race in Proxier.OnUpdate
The bug was that the proxier is passed as value on method decleration.
This caused a copy of Proxier to be created when the method was invoked.
The copy being a shallow copy turned out to have them both reference
a same map instance, but their mutexes were different instances.
This turned out to use different mutexes before operating on a same map
instance, which didn't make sense.
2014-08-06 04:34:54 +09:00
Daniel Smith e75854a1f9 Merge pull request #759 from brendandburns/valid
Add c-identifier validation to service ids.
2014-08-05 12:32:02 -07:00
Daniel Smith 6f85a5b8aa Merge pull request #794 from nyaxt/reland_atomicetcd
Remove duplicated defs and reland #694.
2014-08-05 12:07:59 -07:00
Daniel Smith 2d3373664f Merge pull request #765 from brendandburns/service
Add support for regions, and use them for cloud load balancing.
2014-08-05 11:59:36 -07:00
brendandburns cc4300c3ec Merge pull request #757 from lavalamp/repCtl
Remove etcd dep from controller manager
2014-08-05 11:47:31 -07:00
brendandburns f87a93af7a Merge pull request #754 from kelseyhightower/proxy-cleanup
proxy: cleanup and minor refactoring
2014-08-05 11:46:52 -07:00
brendandburns bf40981197 Merge pull request #758 from lavalamp/clientCache
Watch based client cache
2014-08-05 11:46:22 -07:00
Kouhei Ueno c1ec1d6d72 Remove duplicated def of IsEtcdNodeExist 2014-08-06 03:45:50 +09:00
Kouhei Ueno c7947abd9c Revert "Revert "Use atomic create in EtcdHelper.AtomicUpdate""
This reverts commit 73b64aa490.
2014-08-06 03:43:19 +09:00
Brendan Burns 20a8f03d62 Add dns-952-identifier validation to service ids. 2014-08-05 11:40:48 -07:00
Brendan Burns c27ab18481 Don't use zone for regional load balancers. 2014-08-05 11:38:33 -07:00
Brendan Burns 1d8407cf7d Don't hard code load balancer zone. 2014-08-05 11:38:33 -07:00
Daniel Smith 73b64aa490 Revert "Use atomic create in EtcdHelper.AtomicUpdate" 2014-08-05 11:34:00 -07:00
Daniel Smith 51872d65c9 Merge pull request #694 from nyaxt/atomicetcd
Use atomic create in EtcdHelper.AtomicUpdate
2014-08-05 11:19:22 -07:00
Daniel Smith 5ff072030c Merge pull request #746 from smarterclayton/atomic_create
Make create atomic for etcd on Services/ReplControllers
2014-08-05 11:08:55 -07:00
Kouhei Ueno dea1b8c48b Remove 10ms timeout from TestWatch 2014-08-06 01:02:58 +09:00
Kouhei Ueno cf117d5b48 Add test for EtcdHelper.AtomicUpdate concurrent create 2014-08-06 00:30:55 +09:00
Kouhei Ueno 4799b546c9 Make fake_etcd_client threadsafe 2014-08-05 23:37:32 +09:00
Kouhei Ueno 3f9ec452e4 use atomic create in EtcdHelper.AtomicUpdate 2014-08-05 23:37:32 +09:00
Kouhei Ueno b3e5f40988 Fix bug where debug "return" prevented whole TestAtomicUpdate run 2014-08-05 23:37:32 +09:00
Kelsey Hightower 1d3e660248 proxy: cleanup and minor refactoring
This change includes minor refactoring and cleanup of the proxy
package including the following items:

 * Rename source files with misspelling of round robin
 * Remove unnecessary and redundant comments
 * Update comments for clarity
 * Add locking when updating the round-robin index
 * Improve method receiver names
 * Rename the LoadBalance method to NextEndpoint to add clarity

No changes in behaviour have been introduced.
2014-08-05 07:18:12 -07:00
Clayton Coleman 325f9ef005 Make create atomic on etcd for Services/ReplControllers 2014-08-05 01:12:27 -04:00
Clayton Coleman babb7528ce httptest.NewTLSServer is ~0.2s of setup per test
We're not exercising anything TLS related in client and request,
set these back to NewServer.  Should add a new TLS end-to-end
test for hack/test-cmd.sh with real (test) certs.
2014-08-05 00:59:42 -04:00
Kouhei Ueno 6288336436 Rename IsEtcdConflict to IsEtcdTestFailed 2014-08-05 08:07:20 +09:00
Daniel Smith 041d56f3d0 finish testing client/cache 2014-08-04 14:50:01 -07:00
Daniel Smith 03fe91cc4a Add ID to JSONBaseInterface 2014-08-04 14:50:01 -07:00
Daniel Smith a47b65bf8a Add cache package. 2014-08-04 14:50:01 -07:00
Daniel Smith b430cebe72 Remove etcd dependency from controller manager. 2014-08-04 14:29:49 -07:00
Tim Hockin 7f0d470979 Merge pull request #776 from nyaxt/respectzone
ServiceRegistryStorage.Delete should respect zone.
2014-08-04 14:29:46 -07:00
Tim Hockin 471955d310 Merge pull request #775 from nyaxt/misc_cleanup
Minor clean ups for readability
2014-08-04 14:29:07 -07:00
Kouhei Ueno d7fc4637e9 ServiceRegistryStorage.Delete should respect zone. 2014-08-05 06:11:00 +09:00
Daniel Smith 38c4cdff99 Merge pull request #773 from smarterclayton/speed_up_proxy_tests
Remove 8 seconds of unnecessary sleeps from proxy tests
2014-08-04 13:49:07 -07:00
Kouhei Ueno c6ebc4859e Reduce nesting on ServiceRegistryStorage.Create 2014-08-05 05:38:31 +09:00
Daniel Smith f36d2a7ebd Merge pull request #740 from brendandburns/sync
Switched Set to Create in etcd tools
2014-08-04 13:15:08 -07:00
Kouhei Ueno c8e1c6a02f dedupe apiserver.New 2014-08-05 05:11:25 +09:00
Kouhei Ueno afa686ccc8 dedupe registry.MakeEndpointController init 2014-08-05 05:09:49 +09:00
derekwaynecarr e5fd877052 Validate on replicas being non-negative 2014-08-04 15:39:45 -04:00
Clayton Coleman 0c33ed09d4 Remove long sleeps from proxy tests 2014-08-04 15:35:03 -04:00
Clayton Coleman 786b0399c3 Make interval a constant on proxy/config/etcd
Allow future testing of intervals
2014-08-04 15:34:43 -04:00
Brendan Burns ab4918464e Switched Set to Create 2014-08-04 12:10:16 -07:00
roberthbailey fb49ea331d Merge pull request #764 from brendandburns/expect
Fix unit test build.
2014-08-04 10:16:45 -07:00
brendandburns 27426db827 Merge pull request #756 from smarterclayton/expose_encoding_versioning_interfaces
Expose an Encoding/Versioning interface for use with etcd
2014-08-04 10:10:54 -07:00
Brendan Burns d648b2350e Fix unit test build. 2014-08-04 09:50:25 -07:00
brendandburns 81a8ac723f Merge pull request #753 from smarterclayton/remove_expect_no_error_apiserver
Remove expectNoError from apiserver
2014-08-04 09:15:34 -07:00
brendandburns d4860c21a9 Merge pull request #752 from smarterclayton/remove_expect_no_error_util
Remove expectNoError from client, kubelet, and util
2014-08-04 09:15:22 -07:00
brendandburns 97a6aaba53 Merge pull request #751 from smarterclayton/remove_expect_no_error
Remove expectNoError from pkg/registry
2014-08-04 09:14:59 -07:00
brendandburns 6531188f37 Merge pull request #750 from smarterclayton/operation_list_not_returned
/api/v1beta1/operations was returning Not Found
2014-08-04 09:13:27 -07:00