Commit Graph

56 Commits

Author SHA1 Message Date
Michael Schurter
19fd195f79 Add SyncNow test 2016-12-02 16:44:18 -08:00
Michael Schurter
5202944edb Remove lie from comment 2016-11-18 11:05:22 -08:00
Michael Schurter
ec4ce3bbe2 Fix incorrect lock usage around consul maps 2016-11-18 10:12:02 -08:00
Michael Schurter
f0c58d5fcb Fix SyncNow 2016-11-18 10:12:02 -08:00
Michael Schurter
eda45a65d1 New chaos test to exercise consul syncer 2016-11-18 10:12:02 -08:00
Michael Schurter
240318741a Switch syncer tests to use embedded consul 2016-11-15 10:22:25 -08:00
Diptanu Choudhury
df102f921c Removing warn msg 2016-09-04 17:22:49 -07:00
Michael Schurter
ff21ded331 Query consul without helpers in test to be safe 2016-08-31 14:14:17 -07:00
Michael Schurter
8c9f5b7858 Make comment more precise 2016-08-31 10:43:55 -07:00
Michael Schurter
75e18f2419 Fix error message when querying consul fails 2016-08-31 10:42:51 -07:00
Michael Schurter
bcbe49ee2f Assert syncer state is consistent with consul's state 2016-08-31 09:19:54 -07:00
Michael Schurter
1d8d6b57dc Remove extra consul service tracking entirely
Instead just remove all associated services on shutdown.
2016-08-30 17:10:15 -07:00
Michael Schurter
a63b2ccfdc Fix old services not getting removed from consul on update
Fixes #1661
2016-08-30 16:36:42 -07:00
capone
7f53d0258e Fixed CR defects 2016-08-24 01:33:44 +03:00
capone
1a37bc33c6 First attemt to fix issue #1636 2016-08-23 19:09:20 +03:00
Diptanu Choudhury
53ab5d52d8 Cleaning up some code 2016-08-16 15:22:26 -07:00
Marin
fbb9108ed5 Add support for initial check status 2016-08-16 12:05:15 -07:00
David Bresson
e41b70ca7d Add a test for query string support 2016-08-11 12:22:46 -07:00
David Bresson
7a78bf4836 Add error handling to check registration 2016-08-11 11:49:48 -07:00
David Bresson
e191b0e198 Add support for query strings in check paths 2016-08-11 11:27:29 -07:00
Alex Dadgar
08628fea90 consul syncer uses multi-error 2016-08-09 12:24:50 -07:00
Diptanu Choudhury
473d165c0d Using net.JoinHostPort instead of handcrafting addrs 2016-07-08 16:45:14 -07:00
Diptanu Choudhury
6cb5fd3694 Allowing ports to be overriden in check definitions 2016-07-08 14:14:25 -07:00
Sean Chittenden
c093f4caf5 Teach config.ConsulConfig how to construct a consulapi TLS client.
Said differently, centralize the creation of consul's client config
in one place and use it everywhere.
2016-06-16 22:51:06 -07:00
Sean Chittenden
e5f65e5c7c Fix tests, don't take the address of DefaultConsulCommand() 2016-06-16 21:21:39 -07:00
Sean Chittenden
7dc7fcf052 Create config.DefaultConsulConfig() 2016-06-16 20:41:05 -07:00
Sean Chittenden
aea3e2c360 Temporarily disable various syncer checks due to the API changes made earlier today. 2016-06-13 19:52:17 -07:00
Sean Chittenden
388ef7f6af Drive-by comment correction 2016-06-13 18:14:50 -07:00
Alex Dadgar
f320b5a76f address comments 2016-06-13 17:32:18 -07:00
Alex Dadgar
1e4ec6b2b3 Fix IDs and domain scoping 2016-06-13 16:30:58 -07:00
Diptanu Choudhury
d64ec9d138 Removing unwated line of code 2016-06-13 15:37:55 +02:00
Diptanu Choudhury
02b320c81e implemented reconciliation of unwanted services 2016-06-13 14:52:26 +02:00
Alex Dadgar
e90e92da9f register checks 2016-06-12 21:28:56 -07:00
Alex Dadgar
b1351a3564 Do not reconcile in client and cleanup executor a bit 2016-06-12 18:22:07 -07:00
Alex Dadgar
d0e3dc6a81 Merge pull request #1264 from hashicorp/b-rename-services
Rename ConsulService back to Service
2016-06-12 16:44:49 -07:00
Diptanu Choudhury
b6d9623b9d Remove initial delay of registering services with consul 2016-06-13 01:42:56 +02:00
Alex Dadgar
c5059fc7c4 Rename ConsulService back to Service 2016-06-12 16:36:49 -07:00
Sean Chittenden
a8b53b05b4 Prefer %+q over %q in log messages. 2016-06-11 18:17:20 -04:00
Sean Chittenden
5331ea7bc6 goling(1) compliance pass (e.g. Rpc* -> RPC) 2016-06-10 23:38:28 -04:00
Sean Chittenden
6819f2b68d Query for the Nomad service across multiple Consul datacenters. 2016-06-10 23:05:14 -04:00
Sean Chittenden
91582dc875 Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
aff951ca4e Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
c426b8501c Hand wave over the syncer tests atm, these will be fixed shortly. 2016-06-10 15:54:39 -04:00
Sean Chittenden
69aa8e8195 Don't spam the consul if Consul is not available.
Log once when Consul goes away, and log when Consul comes back.
2016-06-10 15:54:39 -04:00
Sean Chittenden
f7b2949f11 Properly cover Syncer attributes with the registryLock.
trackedServices, delegateChecks, trackedChecks, and checkRunners
should all be covered.  This lock needs to be reasonably narrow and
can't use defer due to possible recursive locking concerns further
downstream from the call sites.
2016-06-10 15:54:39 -04:00
Sean Chittenden
27f6ffd83d On Syncer Shutdown, remove all services that match a Syncer's prefix. 2016-06-10 15:54:39 -04:00
Sean Chittenden
7d060c20d7 Sync checks with Consul by comparing the AgentCheckReg w/ ConsulService
The source of truth is the local Nomad Agent.  Any checks are not local that
have a matching prefix are removed.  Changed checks are re-registered
and missing checks are re-added.
2016-06-10 15:54:39 -04:00
Sean Chittenden
19f765eb05 Sync services with Consul by comparing the AgentServiceReg w/ ConsulService
The source of truth is the local Nomad Agent.  Any services not local that
have a matching prefix are removed.  Changed services are re-registered
and missing services are re-added.
2016-06-10 15:54:39 -04:00
Sean Chittenden
d1ab21f2f7 Generate and sync Consul ServiceIDs consistently 2016-06-10 15:54:39 -04:00
Sean Chittenden
5913acfd69 Rename runChecks to consulAvailable
Apologies in advance for the variable thrash, the fingerprinter is
no longer used to gate whether or not Consul is available any more.
2016-06-10 15:54:39 -04:00