Commit Graph

34 Commits (022c103699bc764ffbcc18f1d4666c017ddd8751)

Author SHA1 Message Date
Clayton Coleman bddef32193 Prepare EtcdHelper to extract more data from Node
In order to support graceful deletion, the resource object will
need access to the TTL value in etcd.  Also, in the future we
may want to get the creation index (distinct from modifiedindex)
and expose it to clients.  Change EtcdResourceVersioner to be
more type specific (objects vs lists) and provide a default
implementation that relies on the internal API convention.

Also, rename etcd_tools.go to etcd_helper.go and split a few
things up.
2015-03-16 15:33:50 -04:00
Clayton Coleman 4ca90e0343 FakeEtcdClient should return KeyNotFound on Delete 2015-03-16 14:22:03 -04:00
Mike Danese 438052c453 fix variable shadowing bug in etcd_tools.go 2015-03-05 22:34:28 -08:00
Clayton Coleman 23d199ded9 Make generic etcd more powerful and return operations from etcd
When we complete an operation, etcd usually provides a response
object.  Return that object up instead of querying etcd twice.
2015-02-13 13:11:33 -05:00
saadali a41f520bf0 Add "Update Event" to Kubernetes API 2015-02-05 00:07:51 -08:00
Deyuan Deng d30da9a812 List objects in deterministic order 2015-01-27 09:29:40 -05:00
Clayton Coleman 880ecef6fe Move locks on watch to allow testing blocking 2015-01-07 14:38:38 -05:00
Brendan Burns d7dc20fd6a Add etcd to the list of services to validate.
Also add minions.
2014-11-05 21:22:01 -08:00
Brendan Burns cf4fd8753f Fix a missing lock in the fake etcd client. 2014-10-31 21:36:03 -07:00
Daniel Smith 9a9362e896 Add generic registry object so we can stop rewriting this code 2014-10-10 15:46:49 -07:00
Daniel Smith 4d4ebcd38e Add ttl parameter to CreateObj 2014-09-25 12:08:14 -07:00
Daniel Smith 0d69393a43 make watch actually return an error when there's an error 2014-09-19 17:53:55 -07:00
Tim Hockin 0f97a73c1b Rename a bunch of "Make" functions to "New"
Also rename some to other names that make better reading.  There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things.  It seemed that "make" there seemed fine.  "New"
is for "constructors".
2014-08-20 21:27:19 -07:00
Daniel Smith daab393562 Merge pull request #780 from brendandburns/native
Add a utility for doing master election via etcd.
2014-08-15 11:48:13 -07:00
Brendan Burns a17acd30ee Add a utility for doing master election via etcd. 2014-08-15 11:42:16 -07:00
Eric Tune 7de0df0be8 Remove unreachable code. 2014-08-14 13:56:42 -07:00
brendandburns 3222f61bca Merge pull request #557 from lavalamp/podLocation
Prepare for external scheduler
2014-08-11 15:27:24 -07:00
Clayton Coleman c5630a9567 Watch delivers current state for resourceVersion=0
Allows clients to get the current state without having to execute
a get followed by a watch.  Makes integration with action loops
much cleaner.
2014-08-11 17:07:14 -04:00
Daniel Smith b7752a86d4 Add debugging info printing to etcd fake
And make tests pass again.
2014-08-11 13:09:24 -07:00
Kouhei Ueno c7947abd9c Revert "Revert "Use atomic create in EtcdHelper.AtomicUpdate""
This reverts commit 73b64aa490.
2014-08-06 03:43:19 +09:00
Daniel Smith 73b64aa490 Revert "Use atomic create in EtcdHelper.AtomicUpdate" 2014-08-05 11:34:00 -07:00
Kouhei Ueno 4799b546c9 Make fake_etcd_client threadsafe 2014-08-05 23:37:32 +09: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 648b80e5d7 Implement FakeEtcdClient.ExpectNotFoundGet 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
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 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
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 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