Commit Graph

178 Commits

Author SHA1 Message Date
Kouhei Ueno
b3e5f40988 Fix bug where debug "return" prevented whole TestAtomicUpdate run 2014-08-05 23:37:32 +09:00
Clayton Coleman
325f9ef005 Make create atomic on etcd for Services/ReplControllers 2014-08-05 01:12:27 -04:00
Kouhei Ueno
6288336436 Rename IsEtcdConflict to IsEtcdTestFailed 2014-08-05 08:07:20 +09:00
Brendan Burns
ab4918464e Switched Set to Create 2014-08-04 12:10:16 -07:00
Clayton Coleman
4448be2d95 Expose an Encoding/Versioning interface for use with etcd
etcd_tools.go is not dependent on the specific implementation
(which is provided by pkg/api).  All EtcdHelpers are created
with an encoding object which handles Encode/Decode/DecodeInto.
Additional tests added to verify simple atomic flows.

Begins to break up api singleton pattern.
2014-08-03 21:35:33 -04:00
Daniel Smith
928092e79e Etcd watcher verification
To make sure the etcd watcher works, I changed the replication
controller to use watch.Interface. I made apiserver support watches on
controllers, so replicationController can be run only off of the
apiserver. I made sure all the etcd watch testing that used to be in
replicationController is now tested on the new etcd watcher in
pkg/tools/.
2014-07-31 14:54:30 -07:00
Kouhei Ueno
d4a5ba863d Add test for AtomicUpdate 2014-08-01 02:35:38 +09:00
Kouhei Ueno
648b80e5d7 Implement FakeEtcdClient.ExpectNotFoundGet 2014-08-01 02:35:38 +09:00
Kouhei Ueno
a3771c9042 AtomicUpdate should use api.Encode 2014-08-01 02:35:38 +09:00
Kouhei Ueno
6dd1e9cbb5 Implement FakeEtcdClient.CompareAndSwap 2014-08-01 02:35:38 +09:00
Kouhei Ueno
ccb7e8793b return EtcdErrorNodeExist when Create is called for existing node 2014-08-01 02:35:37 +09:00
Kouhei Ueno
d46bfcb132 Fail immediately if f.Err is set 2014-08-01 02:35:37 +09:00
Kouhei Ueno
e40cdd50ed Generate modification index only if f.TestIndex is specified.
This is for compatibility with existing tests.
2014-08-01 02:34:08 +09:00
Kouhei Ueno
b82bb37c89 FakeEtcdClient: Maintain change index 2014-08-01 02:34:08 +09:00
Daniel Smith
2396bdfa1b Incorporate new types into versioned api system.
* Made externalize/internalize generic to prevent boilerplate.
* Add fuzz testing.
* All objects pass fuzz tests now.
* This turned up some things we'll need to fix eventually. Left TODOs.
2014-07-29 15:46:57 -07:00
Brendan Burns
f1d6069b01 Use Decode/Encode in etcd_tools 2014-07-28 11:27:36 -07:00
Kelsey Hightower
87fa19cdfe Remove extra test flags from all commands
Currently all commands are being build with extra flags. The extra
flags appear because of a direct import of the testing package from
the fake_etcd_client.go source file.

Remove the direct import of the testing package. Add a tools.T
interface to support existing behavior. Also clean up two TODO items
by remove using of the expectError and expectNoError functions.

Fixes #579
2014-07-27 14:19:18 -07:00
Clayton Coleman
fbd71c9c02 Merge pull request #535 from lavalamp/etcdWatcher
Etcd watcher
2014-07-25 08:40:05 -04:00
Brendan Burns
bf5ae4bb9d Fork API types. 2014-07-24 21:47:08 -07:00
Daniel Smith
b630c7bcb4 Implement watch.Interface via etcd. 2014-07-23 15:04:08 -07:00
Clayton Coleman
2a2fdb4773 Merge pull request #505 from lavalamp/clientWatch
Add client watch capability
2014-07-21 22:11:02 -04:00
Clayton Coleman
09294b90ce Refactor Kubelet config sources for clarity
Create a new "Pod" concept which can identify pods from
many config sources.
2014-07-21 21:18:36 -04:00
Daniel Smith
91375f4c04 Split httpWatcher into watch.StreamWatcher and tools.APIEventDecoder. 2014-07-21 16:07:58 -07:00
Yuki Yugui Sonoda
2aa3de12d4 Make RESTful operations return 404 Not Found when the target resource
does not exist.

In the original implementation, GET, DELETE and PUT operations on
non-existent resources used to return 500 but not 404.
2014-07-18 14:16:56 +09:00
Kouhei Ueno
bba23e28c2 Define EtcdErrorCode as constant and reuse EtcdError instances 2014-07-15 20:48:06 +09:00
Nan Deng
e13e31866d fix data races in controller 2014-07-02 23:22:09 -07:00
Daniel Smith
3b9735d787 Test atomic PUTs, and make them work.
Improve apiserver/logger.go's interface (it's pretty cool now).

Improve apiserver's error reporting to clients.

Improve client's handling of errors from apiserver.

Make failed PUTs return 409 (conflict)-- http status codes are amazingly
well defined for what we're doing!
2014-07-02 15:42:05 -07:00
Daniel Smith
a6144f656c Move etcd helpers to tools package so they can depend on api package. Add ResourceVersion, hook it up to etcd index to get atomic PUTs. 2014-07-02 15:42:05 -07:00