Commit Graph

109 Commits

Author SHA1 Message Date
Asim Aslam
982e6068cf support services without version 2018-03-01 17:35:13 +00:00
Asim Aslam
d0d9582b81
Merge pull request #206 from darren-west/master
Added Options() to registry interface
2018-02-19 20:52:28 +00:00
Asim Aslam
02260dcaa3 Add watch options 2018-02-19 17:12:37 +00:00
Siyun Wu
7c8d6087de add https support for consul
using enviroment variables

for example:
export CONSUL_HTTP_SSL=1
export CONSUL_HTTP_ADDR="https://example.com"
export CONSUL_CLIENT_CERT="/Users/foo/.ssh/consul/consul.cert"
export CONSUL_CLIENT_KEY="/Users/foo/.ssh/consul/consul.key"
export CONSUL_CACERT="/Users/foo/.ssh/consul/ca.cert"
2017-11-20 15:34:52 +08:00
Asim Aslam
1f03681d82 set test to use localhost 2017-11-09 14:21:26 +00:00
Asim Aslam
1c1d46e1ac Add some test logging 2017-11-09 14:16:35 +00:00
darren-west
d970586a29 Added Options() to registry interface 2017-09-28 11:16:56 +01:00
Sergey Sarbash
db0df07fd6 Check for uninitialized *config.HttpClient 2017-08-15 10:49:24 +03:00
Sergey Sarbash
fd01ead575 Fixes nil pointer dereferencing for Consul TLS transport 2017-08-15 09:27:39 +03:00
Emil Huseynaliev
9e1550db53 Update consul_watcher.go
`WatchPlan` was renamed to `Plan` in the consul `watch` package in commit d7e23857ad
2017-04-25 16:38:35 -04:00
Asim Aslam
90ed1390ee fix broken test 2017-04-17 15:31:50 +01:00
wangkechun
059b9d36d7 fix fmt str 2017-02-25 22:53:25 +08:00
Asim Aslam
71d717a06d strip doc.go files 2016-12-14 15:41:48 +00:00
Asim
c289f6acaa Make use of consul 0.7 deregister field. Now auto reaps dead services 2016-11-25 11:23:37 +01:00
chriss
fabdd4a704 Remove consul token helper method.
A Consul config struct can be passed using the `Config` helper making this helper redundant.
2016-11-21 16:16:24 +00:00
Asim
f9709ffa6e ensure the code does not panic 2016-11-18 07:30:50 +00:00
chriss
8a25723fe0 Set consul token via registry options.
Optionally configure a token to use with the consul client.
2016-11-18 00:07:12 +00:00
chriss
3d7187f405 Add the ability to pass consul client config via registry options.
This can be used when you need to configure the consul client to use a specific configuration (E.G to pass a Token if consul is using ACL policies)
2016-11-17 23:24:14 +00:00
Jelmer Snoeck
e59f7a7ace
ConsulRegistry: use health checks to select nodes.
Consul sees a healthcheck that is in the warning state as a "failed"
node. This means that when we ask Consul for services that are passing,
it would not return nodes that have warning healthchecks.

In the cache, we only check on critical to skip for nodes. This makes
the cache out of sync with the non-cache implementation.

This patch reworks the non-cache implementation to ask for all nodes
(even unhealthy ones) and does the same check as within the cache, skip
nodes that have critical healthchecks.

We've noticed this issue when we deployed custom healthchecks where the
cache was acting properly, but after 1 minute we saw "None Available"
errors. This is due to the TTL expiry on the cache, which is then
followed by doing a non cached request.
2016-08-26 08:36:45 +01:00
Asim
71d64f911f make a copy of services for handle method 2016-08-24 18:37:11 +01:00
Asim
0afaaeec8d make a copy of services 2016-08-24 18:27:15 +01:00
Jelmer Snoeck
81231c0b6f
ConsulWatcher: deregister if service checks fail. 2016-08-11 15:18:50 +01:00
Asim
2d6c403992 don't close next chan, instead use exit chan 2016-07-30 11:58:10 +01:00
Asim
6aac602b31 return error when zero services in mock registry 2016-06-30 20:11:04 +01:00
Asim
1254a87286 Add package comments 2016-05-24 22:22:46 +01:00
Asim
04bc20798d Don't strip decode because its good to be backwards compatible still 2016-05-22 18:43:47 +01:00
Asim
2708f9c04b No longer need to test old encoding 2016-05-22 18:41:06 +01:00
Asim
06ee80fd0a Strip old encoding 2016-05-22 18:34:47 +01:00
Asim
e541d45f38 When the TTL flips to critical we should issue a delete event 2016-05-03 18:34:57 +01:00
Asim
d3de45409f Simplify watcher test 2016-05-01 22:30:33 +01:00
Asim
7996785195 Try a different way of testing 2016-05-01 22:05:21 +01:00
Asim
3709831d8e Watch results may be unordered 2016-05-01 21:38:22 +01:00
Asim
50eb97129e Add watcher test 2016-05-01 21:30:14 +01:00
Asim
96104aa209 Add mdns test and fix the bug it revealed 2016-05-01 21:21:15 +01:00
Asim
e14f9a0380 Add watcher.... OH YEAAA 2016-05-01 19:31:03 +01:00
Asim
59f1a9a07b Use mdns-sd service 2016-04-30 00:22:31 +01:00
Asim
ae8c948202 Use our fork of mdns with all the updates 2016-04-30 00:15:00 +01:00
Asim
c26f989bbb Fix encoding so we split across txt records 2016-04-28 18:36:59 +01:00
Asim
6c108d95b2 First attempt at mdns 2016-04-27 18:21:05 +01:00
Asim
3d3044404e Don't add to defaults in func init, just add them to cmd 2016-04-26 18:49:02 +01:00
Asim
f7c57fd4f4 Mock watcher that just blocks 2016-04-26 18:32:43 +01:00
Asim
e2855c4bc2 Fix some mapping issues while we're at it 2016-04-09 22:19:03 +01:00
Asim
9d7bd3f424 God damn you nil map 2016-04-09 21:34:45 +01:00
Asim
b3fbd36ba7 Don't re-register if the state hasn't changed 2016-04-09 21:30:31 +01:00
Asim
bfe20d81d0 More linting fun 2016-04-06 18:03:27 +01:00
Asim Aslam
c462d7776c Merge pull request #63 from micro/encoding
Fix Consul WARN issues for tags
2016-04-05 16:14:28 +01:00
Asim
17a97e2ef1 Set ver 2016-03-29 18:32:16 +01:00
Asim
cb89b2ebca update encoding test 2016-03-29 18:16:55 +01:00
Asim
61178d1b45 Update encoding to be backwards compatible. 2016-03-29 17:44:46 +01:00
Asim
0a81cb1190 unexport mock registry 2016-03-17 22:54:18 +00:00