Commit Graph

84 Commits

Author SHA1 Message Date
Alex Dadgar
3642434293 Fix tests 2017-05-03 15:14:19 -07:00
Michael Schurter
58430bf062 Fix consul test build on Windows 2017-04-19 16:14:11 -07:00
Michael Schurter
b9ea2765ec Thanks go vet! 2017-04-19 13:05:41 -07:00
Michael Schurter
4cf34edb29 Skip checks with TLSSkipVerify if it's unsupported
Fixes #2218
2017-04-19 12:45:34 -07:00
Michael Schurter
6d9e61bb51 Use spiffy new Go 1.8 subtest feature 2017-04-19 12:42:48 -07:00
Michael Schurter
5948daf4f7 Forgot an important word 2017-04-19 12:42:48 -07:00
Michael Schurter
346838381b Only register HTTPS agent check when Consul>=0.7.2
Support for TLSSkipVerify in other checks coming soon!
2017-04-19 12:42:48 -07:00
Michael Schurter
f0bec63174 Explain weird timer logic 2017-04-19 12:42:48 -07:00
Michael Schurter
de3d78365e Metricsify new Consul client 2017-04-19 12:42:48 -07:00
Michael Schurter
d3f3af8bf9 Always fail script checks when deadline exceeded 2017-04-19 12:42:48 -07:00
Michael Schurter
465cc5157b Test script check exit codes 2017-04-19 12:42:47 -07:00
Michael Schurter
6a56b0efc6 Follow _testing.go convention for testing tools 2017-04-19 12:42:47 -07:00
Michael Schurter
927b265854 Rework to account for ports not being in IDs
Previous implementation assumed all struct fields were included in
service and check IDs. Service IDs never include port labels and check
IDs *optionally* include port labels, so lots of things had to change.

Added a really big test to exercise this.
2017-04-19 12:42:47 -07:00
Michael Schurter
7de3adaf87 Remove commits return value
...and still protect against leaking agent entries in Consul on
shutdown.
2017-04-19 12:42:47 -07:00
Michael Schurter
5d75efc397 Explain PortLabel handling in RegisterAgent 2017-04-19 12:42:47 -07:00
Michael Schurter
48269c36b0 Plumb alloc id + task name into script check logs 2017-04-19 12:42:47 -07:00
Michael Schurter
80617a9c1a Stop being lazy and just type out struct{}{} 2017-04-19 12:42:47 -07:00
Michael Schurter
7ac9215fb7 Use nifty testtask sleep command for xplat compat 2017-04-19 12:42:47 -07:00
Michael Schurter
4002d87a6b Add comments, clarify names, fix PR comments 2017-04-19 12:42:47 -07:00
Michael Schurter
b4c7d92936 Explain cleanup defer in test 2017-04-19 12:42:47 -07:00
Michael Schurter
a3fc76b63a Fix comment to reflect reality 2017-04-19 12:42:47 -07:00
Michael Schurter
63a8307255 Move ScriptExecutor to driver 2017-04-19 12:42:47 -07:00
Michael Schurter
b4e40efa15 Fix shutdown when consul is down 2017-04-19 12:42:47 -07:00
Michael Schurter
80882f3e0e Switch ServiceClient to synchronizing state
Previously it applied a stream of operations. Reconciling state is less
complex and error prone at the cost of slightly higher CPU/memory usage.
2017-04-19 12:42:47 -07:00
Michael Schurter
b6937912d8 Add UpdateTask method instead of Remove/Add 2017-04-19 12:42:47 -07:00
Michael Schurter
7930d35925 Remove some lies 2017-04-19 12:42:47 -07:00
Michael Schurter
e13b149628 Remove unused syncInterval 2017-04-19 12:42:47 -07:00
Michael Schurter
10cb924b2c Refactor Consul Syncer into new ServiceClient
Fixes #2478 #2474 #1995 #2294

The new client only handles agent and task service advertisement. Server
discovery is mostly unchanged.

The Nomad client agent now handles all Consul operations instead of the
executor handling task related operations. When upgrading from an
earlier version of Nomad existing executors will be told to deregister
from Consul so that the Nomad agent can re-register the task's services
and checks.

Drivers - other than qemu - now support an Exec method for executing
abritrary commands in a task's environment. This is used to implement
script checks.

Interfaces are used extensively to avoid interacting with Consul in
tests that don't assert any Consul related behavior.
2017-04-19 12:42:47 -07:00
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