Madhu Venugopal
23ecada9d7
Adding export Init method for the exported discovery components
...
Since Swarm discovery is used by libnetwork without the swarm main(), it
is forced to use annonymous import in order to force-trigger the
unexported init() methods. Using annonymous import is highly discouraged
in a Non-Main and Non-Test packages.
Introducing exported Init() methods on these files so that libnetwork
can use Discovery as a library without having a main package.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-20 20:18:13 -07:00
Alexandre Beslic
c1494dd076
Merge pull request #819 from aluzzardi/leadership
...
Leader Election
2015-05-20 14:16:23 -07:00
Andrea Luzzardi
a81c5436bb
leadership: Fix README
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-20 13:58:27 -07:00
Victor Vieux
53e3c5b05f
Merge pull request #820 from vieux/rename_destroy
...
rename Destroy ro RemoveContainer for consistency
2015-05-20 13:29:21 -07:00
Victor Vieux
b3222a8f11
rename Destroy ro RemoveContainer for consistency
...
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-20 12:53:02 -07:00
Victor Vieux
89d3c2a4cb
Merge pull request #814 from jimmyxian/fix-bool-value
...
Fix #810 bool value
2015-05-20 10:09:11 -07:00
Andrea Luzzardi
3f01413b75
leadership: Distributed Leader Election
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:14:28 -07:00
Andrea Luzzardi
78839ba4ea
store: Improved locking API and added mocks.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:14:28 -07:00
Andrea Luzzardi
2ff9679938
store: CreateStore -> NewStore
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:13:29 -07:00
Andrea Luzzardi
71a5fd944a
Merge pull request #801 from abronan/add_ephemeral_support
...
store: Add node Ephemeral support
2015-05-19 20:13:06 -07:00
Xian Chaobo
df50eb8c67
add unit test
...
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-19 21:54:03 -04:00
Alexandre Beslic
38f78b02b5
Reset ephemeral session on renewal failure
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 18:30:59 -07:00
Alexandre Beslic
b8d72c291d
Cleanup, fix Integration tests and use of a single global Session in Consul
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 15:27:39 -07:00
Alexandre Beslic
4537b9f2ba
Remove unused code
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:57:43 -07:00
Alexandre Beslic
5d106186fb
remove the periodic session renewal in Consul until we figure out what to do with etcd..
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:31:39 -07:00
Alexandre Beslic
ec478d8ed5
Add integration tests for engines departure with node removal and ephemeral behavior
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:08:56 -07:00
Alexandre Beslic
f81de46ab4
Fix Consul and etcd with latest changes, use etcd v2.0.11 for integration tests, remove call to SyncCluster for now (breaks the integration tests)
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic
4408a9cc8c
Add Ephemeral for Consul, Zookeeper and Etcd (Etcd abd Consul are using TTLs in the background)
...
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic
d5915b2a09
Merge pull request #811 from aluzzardi/node-removal
...
Handle Node Removal from Discovery correctly
2015-05-19 10:11:10 -07:00
Xian Chaobo
24eb0adbb0
fix #810 bool value
...
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-19 04:01:41 -04:00
Victor Vieux
7b3c889407
Merge pull request #809 from jimmyxian/bugfix-volumes-from
...
fix #807 : support --volumes-from rw/ro
2015-05-18 19:41:36 -07:00
Andrea Luzzardi
3c4b19ed26
Merge pull request #812 from docker/flag_to_env
...
adding environment variable option when treating flags
2015-05-18 19:08:53 -07:00
Isabel Jimenez
8001455ecf
adding ip as an option for flags
...
Signed-off-by: Isabel Jimenez <contact.isabeljimenez@gmail.com>
2015-05-18 20:34:57 -04:00
Isabel Jimenez
19d51f4a1a
adding environment variable option when treating flags
...
Signed-off-by: Isabel Jimenez <contact.isabeljimenez@gmail.com>
2015-05-18 20:16:21 -04:00
Andrea Luzzardi
55c52f7a92
Merge pull request #799 from vieux/update_usage
...
update usage to look more like the engine/machine
2015-05-18 14:16:20 -07:00
Victor Vieux
a43f10adc4
update usage to look more like the engine/machine
...
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-18 13:57:43 -07:00
Andrea Luzzardi
dd48440d98
api: "Host Down" instead of "Pending" as a status
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi
8c9449899b
api: Log requests to debug level
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi
7dec704b8a
integration: node removal for file discovery
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi
d7b8734e97
cluster: Handle node removal
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi
7c0dba5de6
engine: Support for disconnection
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi
08dc3c7c7b
discovery: Add the Entries.Diff helper.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:54:51 -07:00
Victor Vieux
2fd48d8ac4
Merge pull request #805 from aluzzardi/discovery-watch
...
Revamped Discovery: Channel based and resilient to errors
2015-05-18 13:53:13 -07:00
Andrea Luzzardi
6fbbfd7287
integration: give zk some extra time.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:45:11 -07:00
Andrea Luzzardi
3d6f833f6f
fix --heartbeat flag.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:15 -07:00
Andrea Luzzardi
0c9e8c8803
discovery: Added kv tests using the mock Store.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:15 -07:00
Andrea Luzzardi
2106966d54
discovery: Watch tests for file and some other tests.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
f49ca7e20f
store: Mock stores can now be created
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
b459f7c7f8
store: Add Mock store.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
9399a8835c
golint fixes.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
ac18ef381d
integration: cover more grounds in discovery testing.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
9179ed3d34
integration: move discovery into its own folder
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
7430fe5141
fix hb/timeout being time.Duration in a few places
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
0c72bcaf40
discovery cleanup: heartbeat is a time.Duration.
...
- Use a time.Duration instead of a uint64 for hb
- Flags can accept durations: --heartbeat 25s
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
f33c03af93
discovery: Push watch errors to a channel
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
5756e83fcb
store/consul: Watch: Use a WaitTime so we can check stopCh.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
2a27adaea1
discovery integration: No need to wait anymore
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
3de0b5f567
join: Don't give up if registration fails, just retry.
...
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi
97984881c3
discovery: New channel based API.
...
- Watch() issues updates by channel rather than by callback
- Fetch() is gone
- Watch() can be stopped at any time by closing the stop channel
- Watch() is now resilient to errors and will try over and over
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:13 -07:00
Andrea Luzzardi
d1b1f520f2
Merge pull request #803 from vieux/fix_match_container
...
fix container matching algorithm
2015-05-18 13:38:01 -07:00