Commit Graph

160 Commits

Author SHA1 Message Date
Andrea Luzzardi 7d7e4aee13 store: Watch: Use channels instead of callbacks.
This gets rid of `CancelWatch*` functions and its usage is much simpler.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 0f61855877 store: Get rid of "discovery" log messages
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:35:14 -07:00
Andrea Luzzardi a897fa04d5 store: Watch/WatchTree: Removed unused params
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:25:26 -07:00
Andrea Luzzardi f87505e2e7 store: KVEntry -> KVPair
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:00:27 -07:00
Andrea Luzzardi 895484ec2a store: WatchRange -> WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 6f41eabdae store: GetRange -> List
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi d4bdb10d35 store: Make KVEntry a struct rather than an interface.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 747a83a40a store: Cleanup initializers.
- KV is now Backend
- name (string) is now backend (Backend)
- initializers are now a static var rather than generated by init()

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:32:10 -07:00
Kelsey Hightower 0d87489773 discovery: improve code comments.
Signed-off-by: Kelsey Hightower <kelsey.hightower@gmail.com>
2015-05-14 08:49:40 -07:00
Andrea Luzzardi 9d055d6bf8 pkg/store: Pass Options as pointer, not value.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-13 19:00:39 -07:00
Victor Vieux 0b45fa5154 user varargs in store the watch callback
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-13 15:42:44 -07:00
Madhu Venugopal 0130c2262d GetRange and WatchRange to return {key,value,index} tuple
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-13 11:24:03 -07:00
Alexandre Beslic 06f51e09b0 revert variable names
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:47:48 -07:00
Alexandre Beslic 403f95f86c Remove placeholder TLS parameter in discovery interface and New method
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:19:30 -07:00
Alexandre Beslic 6f67ca3a58 replace variadic method options for simple Config struct, correct Consul Watch method
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:00:55 -07:00
Alexandre Beslic e039563c78 Fix zookeeper timeout value
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 18:23:40 -07:00
Alexandre Beslic 59e1e9b942 Change existing discovery backends to 'kv' using metatada storage backends in the store package
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 17:23:55 -07:00
Andrea Luzzardi d492feb7cc golint: DiscoveryService -> Discovery
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-04-15 14:26:39 -07:00
Kushal Pisavadia 78dba5d623 Remove prefixes from DiscoveryService implementations
All of these structs are public. Previously when they were used, they'd
look like the following:

 - `consul.ConsulDiscoveryService`
 - `etcd.EtcdDiscoveryService`
 - `file.FileDiscoveryService`
 - `nodes.NodesDiscoveryService`
 - `token.TokenDiscoveryService`
 - `zookeeper.ZkDiscoveryService`

As a result, they stuttered when read. This commit removes the
duplication of the package names on the struct so that they read better.

See also: https://golang.org/ref/spec#Import_declarations

Signed-off-by: Kushal Pisavadia <kushi.p@gmail.com>
2015-04-15 20:58:17 +01:00
James Turnbull 658c807eb9 Did a quick pass on the docs to fix numerous formatting, spelling and grammar errors
Signed-off-by: James Turnbull <james@lovedthanlost.net>
2015-04-14 11:59:50 -04:00
Mike Goelzer 8aa9d20932 Additional unit tests; raises generator.go test coverage to 100%
Signed-off-by: Mike Goelzer <mike@goelzer.com>
2015-04-12 08:28:45 -07:00
Sriram Natarajan b174aa26de Change heartbeat type to unsigned int
Check if heartbeat value is greater than zero

Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
2015-04-09 00:04:50 +00:00
jangelfdez 17b9b96b33 Doc changed to avoid errors with POST calls to Docker Hub Discovery Service API
The data on the "Add new nodes to a cluster" request may be confusing. It's not a key=value pair as it can be understood with the current docs.

Signed-off-by: jangelfdez <me@joseangelfernandez.es>
2015-04-07 14:36:07 -07:00
Victor Vieux 5e41510484 udpate tests
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-07 10:41:18 -07:00
Yucong Sun b45a985b9b Ignoring # comments in file discovery.
Signed-off-by: Yucong Sun <sunyucong@email.com>
2015-04-07 23:11:57 +08:00
Mike Goelzer bcca57bda8 Make TTL > heartbeat by at least one second to prevent key from disappearing before next heartbeat
Signed-off-by: Mike Goelzer <mike@goelzer.com>
2015-04-02 19:34:30 -07:00
Mike Goelzer 5d289e2434 Fixed url of Docker Hub discovery service
Signed-off-by: Mike Goelzer <mike@goelzer.com>
2015-04-02 09:50:34 -07:00
Sriram Natarajan 74a9a04a60 Fix discovery token README
Signed-off-by: Sriram Natarajan <natarajan.sriram@gmail.com>
2015-04-01 12:09:53 -07:00
Victor Vieux b655cbb7c5 Merge pull request #514 from technolo-g/Issue_499_Automate_golint_pr
Issue #500 Run golint on codebase
2015-03-30 12:14:15 -07:00
Matt Bajor d87c48ae4e Fix lint violations
This changeset fixes all lint violations that show up with a
min_confidence of 1

- Issue #500: Run golint on codebase

Signed-off-by: Matt Bajor <matt@notevenremotelydorky.com>
2015-03-27 21:17:44 -06:00
Chanwit Kaewkasi f1fd1fb145 fix per golint checks
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-03-28 00:52:53 +07:00
Victor Vieux 45fc0c9272 Merge pull request #509 from vieux/nodes-discovery-gen
Proposal: implement IP generator for nodes and file discoveries by @chanwit
2015-03-24 17:00:48 -06:00
Victor Vieux 24093beb85 add quotes in doc
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-03-24 16:49:18 -06:00
Victor Vieux 421c5a2ee5 add https to token doc
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-03-18 17:01:40 -07:00
Chanwit Kaewkasi 92ef21d2ec explain ip generator in discovery/README
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-03-12 15:50:00 +07:00
Chanwit Kaewkasi 882be558e8 add ip generator for file
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-03-12 15:49:58 +07:00
Chanwit Kaewkasi 09b8eb8564 implement ip generator for nodes
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-03-12 15:49:56 +07:00
Sven Dowideit c530cd1523 add an index and go make some small tweaks
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-02-26 11:19:14 +10:00
Ferran Rodenas cecdd7df02 Ignore empty addresses when creating discovery entries
Signed-off-by: Ferran Rodenas <frodenas@gmail.com>
2015-02-24 22:10:31 -08:00
Victor Vieux ff22cbc2d3 fix panic in token discovery
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-18 22:08:07 -08:00
JChien a19fecee87 update import url
Signed-off-by: JChien <jeffchien13@gmail.com>
2015-02-11 21:25:55 +08:00
Victor Vieux 3df8bbed61 refactor createEntries
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 02:25:38 +00:00
Victor Vieux ba01634743 replace discovery.Node by discovery.Entry
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-10 01:58:43 +00:00
Victor Vieux afed2abbea update swarm manage requirements again
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-03 01:57:13 +00:00
Victor Vieux aaac7cbb94 update swarm manage requirements
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-02-02 18:34:24 +00:00
Victor Vieux bcc9f8b7c6 Merge pull request #343 from mota/fix-token-leak
Force connection close with token discovery
2015-02-02 10:18:31 -08:00
Sven Dowideit 14c4fb81cf Add docker.docker.com metadata and reflow to 80-chars for GH diffs
Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>
2015-02-02 09:53:43 +10:00
Pierre Wacrenier e3bf42d5be Force connection close with token discovery
Signed-off-by: Pierre Wacrenier <pierre.wacrenier@gmail.com>
2015-02-01 05:48:30 +01:00
Victor Vieux 29bfee02fe error when token is empty
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-30 22:42:18 +00:00
Andrea Luzzardi ec7d343a88 Merge pull request #306 from vieux/improve_logs1
improve some logs
2015-01-27 12:23:31 -08:00
Chanwit Kaewkasi f5d3efa53e fix fatal error when registering node
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-27 15:32:28 +07:00
Victor Vieux 231ded20e0 improve some logs
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-26 23:41:56 +00:00
Andrea Luzzardi fabe77bdde Merge pull request #283 from chanwit/cleanup-zk-path
Cleanup: implement full path creation for zookeeper
2015-01-26 11:52:22 -08:00
Victor Vieux 3c595e96e2 cleanup
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-26 19:27:25 +00:00
Ankush Agarwal b3bcab711e Add error message when discovery service returns non 200
status code. Update doc for token.go/Fetch

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-01-26 00:18:11 -08:00
Chanwit Kaewkasi 56177ef963 cleanup to support fullpath creation for zookeeper
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-24 16:41:52 +07:00
Victor Vieux 13b96828f2 update tests
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-24 01:58:51 +00:00
Victor Vieux 693fb0fcf1 fix panic with no port
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-24 01:42:35 +00:00
Victor Vieux 02cc59840f Revert "Fixes panic when ports are not specified"
This reverts commit a916f9cde0.

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-24 01:42:15 +00:00
Brian Goff a916f9cde0 Fixes panic when ports are not specified
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-01-23 15:56:14 -05:00
Victor Vieux 1581dcff6c support hostname without nodes://
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-23 10:42:20 -08:00
Victor Vieux ecb47032bd fix panics in etcd and zookeeper + add tests
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-22 19:40:24 +00:00
Victor Vieux e9f487bcaf update README.mds
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-21 22:47:31 +00:00
Victor Vieux 6e79a0e345 add tabs in the help
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-13 21:42:55 +00:00
Victor Vieux f8825b644b rename list to nodes
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-13 19:56:53 +00:00
Victor Vieux 7d7a8e0cba add doc
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-13 19:47:36 +00:00
Victor Vieux 957fce6a6c use list of IPs as a discovery
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-13 19:47:36 +00:00
Victor Vieux a638b360ae use tcp:// in doc and update copyrights
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-12 22:58:03 +00:00
Victor Vieux a24e29de3f fix test zk
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-12 22:28:59 +00:00
Victor Vieux 030c715007 Merge pull request #231 from chanwit/cleanup-zookeeper
Cleanup: zookeeper discovery's watcher
2015-01-12 14:20:34 -08:00
Chanwit Kaewkasi 03f4650ac7 add unit test for the cleanup
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-10 00:53:16 +07:00
Chanwit Kaewkasi 1b8166c7a5 callback 1 time before looping over the zookeeper's event channel
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-10 00:52:49 +07:00
Victor Vieux 429965c58d ip:port, no proto or scheme
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-08 22:12:41 +00:00
Victor Vieux d28dafa893 update discovery/README.md
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-01-08 22:11:10 +00:00
Chanwit Kaewkasi f530d0886f implement a proper zookeeper watcher
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:54 +07:00
Chanwit Kaewkasi 1e2e60806d double check if someone delete /path outside swarm
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:52 +07:00
Chanwit Kaewkasi 66ff423861 make node registration more robust
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:50 +07:00
Chanwit Kaewkasi de2081fa19 skip ErrNodeExists for node registration
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:49 +07:00
Chanwit Kaewkasi 195ba02473 add a unit test for zk discovery
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:48 +07:00
Chanwit Kaewkasi 3564e38d80 add zookeeper discovery
Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
2015-01-08 19:34:46 +07:00
Andrea Luzzardi 6a34054e58 Typo: Initialise -> Initialize.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-01-05 07:32:57 -08:00
Victor Vieux cf42030741 update README.md & ROADMAP.md
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-31 00:16:54 +00:00
JChien a94a104932 use consul's watch
Signed-off-by: JChien <jeffchien13@gmail.com>
2014-12-31 00:16:03 +00:00
JChien 6aed8aa673 fix style to match gofmt
Signed-off-by: JChien <jeffchien13@gmail.com>
2014-12-31 00:16:03 +00:00
JChien e0461c7549 fix readme and remove swarm prefix
Signed-off-by: JChien <jeffchien13@gmail.com>
2014-12-31 00:16:03 +00:00
JChien 1a21de143f add consul support as a disovery backend
Signed-off-by: JChien <jeffchien13@gmail.com>
2014-12-31 00:16:03 +00:00
Thomas Meson a66d0fa684 documentation: fix some documentation typos
Signed-off-by: Thomas Meson <zllak@hycik.org>
2014-12-29 10:35:18 +01:00
Victor Vieux c2c790e6da update README.mds
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-15 23:04:00 +00:00
Victor Vieux 98015c6e62 remove useless create fct
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-13 01:21:38 +00:00
Victor Vieux d6baf8bbe2 add a few tests
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-13 01:18:45 +00:00
Victor Vieux e2b6f00c23 WatchCallback
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-13 01:04:16 +00:00
Victor Vieux f2ca549f46 cleaner callback
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-12 22:49:20 +00:00
Victor Vieux a0dd4b9fe8 update README.md
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-12 22:19:09 +00:00
Victor Vieux 005b5fe288 watch take a callback 2014-12-12 22:14:11 +00:00
Victor Vieux 008398cc99 update READMEs
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-11 23:32:48 +00:00
Victor Vieux 1f9eac7fd1 Initialize in the interface
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-11 23:23:10 +00:00
Victor Vieux f95f943b4a use 1.5*heartbeat as TTL in etcd
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-11 22:18:54 +00:00
Victor Vieux 2282fc89ef add node type
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-11 21:59:01 +00:00
Victor Vieux 875e7c7e77 add discovery/README.md 2014-12-11 21:18:13 +00:00
Victor Vieux c38f621425 add etcd
Signed-off-by: Victor Vieux <vieux@docker.com>
2014-12-11 01:24:19 +00:00