Clayton Coleman
154a91cd33
Rename runtime.DefaultScheme to latest.Codec for ease of readability
2014-09-16 16:19:35 -04:00
Clayton Coleman
fe614aeda2
Simple refactor for ease of readability
...
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04:00
Daniel Smith
fc09f988b4
Make tests pass again
2014-09-07 22:26:42 -07:00
Daniel Smith
0d30a656ef
Do interface{} -> runtime.Object rename everywhere
2014-09-07 22:19:24 -07:00
Daniel Smith
1c2b65788d
Rename Codec and ResourceVersioner to add Default in front, to allow for types of those names
2014-09-07 22:19:24 -07:00
Daniel Smith
7790961011
Rename Object to EmbeddedObject
2014-09-05 14:43:35 -07:00
Daniel Smith
a63966e73c
Combine pkg/apitools and pkg/api/common and call the result pkg/runtime
2014-09-02 11:15:44 -07:00
Daniel Smith
099c8fd36f
Propagate rename; tests pass again.
2014-09-02 10:42:06 -07: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
Joe Beda
2d8e160775
Merge pull request #1117 from lavalamp/fixApi
...
Invert api and api/v1beta1 dependencies
2014-08-29 14:59:15 -07:00
Daniel Smith
aa9b9b9fa8
Invert api and api/v1beta1 dependencies
...
This is some cleanup that has been needed for a while.
There's still one more step that could usefully be done, which is to
split up our api package into the part that provides the helper
functions and the part that provides the internal types. That can come
later.
The v1beta1 package is now a good example of what an api plugin should
do to version its types.
2014-08-29 12:15:30 -07:00
Clayton Coleman
bafc422ac0
Add the resource version to api.*List items from etcd
...
Allows clients to watch more easily (can invoke Get, then
Watch).
2014-08-28 23:17:00 -04:00
Clayton Coleman
083d81b6d7
Expose REST resource for endpoints and watch on services/endpoints
...
Will allow kube-proxies to listen on endpoints.
2014-08-27 15:49:01 -04:00
Brendan Burns
d83091ea52
Fix a flake by extending the time out, so we don't race a go routine.
...
Empirically this eliminates a flake.
2014-08-26 17:09:38 -07:00
Daniel Smith
6b69ed402b
Change 'sendCreate' to 'sendAdd'; integration passes.
2014-08-25 15:56:55 -07:00
Daniel Smith
db1c0db5c7
Move etcd watch code to its own files
2014-08-25 15:56:54 -07:00
Daniel Smith
72b35816cd
Need to remove pods that change labels.
2014-08-25 15:56:54 -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
brendandburns
39d2020392
Merge pull request #897 from smarterclayton/watch_starting_too_early
...
Watch should start from next index when getting the initial state
2014-08-15 09:46:13 -07:00
Clayton Coleman
befbf8466f
Only write to etcd if values have changed
...
This prevents certain loops from writing data to etcd every few
seconds (when data hasn't changed).
2014-08-14 20:34:36 -04:00
Clayton Coleman
7c67cbff04
Watch should start from next index when getting the initial state
...
Also, the fake response we return should have an Action that is
appropriate for the operation.
2014-08-14 20:32:46 -04:00
brendandburns
8daf8c7a30
Merge pull request #896 from smarterclayton/return_correct_index_for_delete
...
Delete should use current node, not prev node index
2014-08-14 14:59:52 -07:00
Eric Tune
7de0df0be8
Remove unreachable code.
2014-08-14 13:56:42 -07:00
Clayton Coleman
2872e565a2
Delete should use current node, not prev node index
...
The index an object was deleted on should be resp.Node.ModifiedIndex
2014-08-14 16:14:24 -04:00
Kelsey Hightower
c21a0ca39f
Breakup the registry package into separate packages.
...
Currently all registry implementations live in a single package,
which makes it bit harder to maintain. The different registry
implementations do not follow the same coding style and naming
conventions, which makes the code harder to read.
Breakup the registry package into smaller packages based on
the registry implementation. Refactor the registry packages
to follow a similar coding style and naming convention.
This patch does not introduce any changes in behavior.
2014-08-11 20:58:09 -07:00
brendandburns
3222f61bca
Merge pull request #557 from lavalamp/podLocation
...
Prepare for external scheduler
2014-08-11 15:27:24 -07:00
Daniel Smith
5e34a9784f
Merge pull request #852 from smarterclayton/deliver_state_on_nil_version
...
Watch delivers current state for resourceVersion=0
2014-08-11 15:13:15 -07:00
Dan Mace
b986c520a7
Apply resource versioning to list extractions from etcd
...
Set the resource version on lists of objects extracted from etcd to prevent
them from always being interpreted as new during updates.
2014-08-11 21:11:08 +00: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
Daniel Smith
49cded3800
Simplify ResourceWatcher interface to one function.
2014-08-08 14:09:13 -07:00
Daniel Smith
283fdba6ab
Add more parameters to Watch
...
* Add labels selector (same as List)
* Add fields selector
* Plan to let you select pods by Host and/or Status
* Add resourceVersion to let you resume a watch where you left off.
2014-08-08 14:09:13 -07:00
Clayton Coleman
67dbd15929
Address remaining comments from #756
...
Rename Encoding to Codec, Versioning to ResourceVersioner. Add
GoDoc. Add Delete(key, recursive) to EtcdHelper
2014-08-06 11:25:35 -04: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
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
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