Michael Schurter
8926743106
Fix consul test build on Windows
2017-04-19 16:14:11 -07:00
Michael Schurter
83f9591d75
Thanks go vet!
2017-04-19 13:05:41 -07:00
Michael Schurter
e997ae44a5
Skip checks with TLSSkipVerify if it's unsupported
...
Fixes #2218
2017-04-19 12:45:34 -07:00
Michael Schurter
4910f867e7
Use spiffy new Go 1.8 subtest feature
2017-04-19 12:42:48 -07:00
Michael Schurter
3e8dd386ee
Forgot an important word
2017-04-19 12:42:48 -07:00
Michael Schurter
947e31e9c2
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
383f21559e
Explain weird timer logic
2017-04-19 12:42:48 -07:00
Michael Schurter
4db840b54e
Metricsify new Consul client
2017-04-19 12:42:48 -07:00
Michael Schurter
59c687c940
Always fail script checks when deadline exceeded
2017-04-19 12:42:48 -07:00
Michael Schurter
ca29bb2cac
Test script check exit codes
2017-04-19 12:42:47 -07:00
Michael Schurter
6f6431ce0b
Follow _testing.go convention for testing tools
2017-04-19 12:42:47 -07:00
Michael Schurter
2a11508cc8
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
6e0fd86361
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
fb52bbfa45
Explain PortLabel handling in RegisterAgent
2017-04-19 12:42:47 -07:00
Michael Schurter
2728216f6f
Plumb alloc id + task name into script check logs
2017-04-19 12:42:47 -07:00
Michael Schurter
01b20cbb59
Stop being lazy and just type out struct{}{}
2017-04-19 12:42:47 -07:00
Michael Schurter
5e908dbf38
Use nifty testtask sleep command for xplat compat
2017-04-19 12:42:47 -07:00
Michael Schurter
8c433cfba1
Add comments, clarify names, fix PR comments
2017-04-19 12:42:47 -07:00
Michael Schurter
40b3987e90
Explain cleanup defer in test
2017-04-19 12:42:47 -07:00
Michael Schurter
7c8ad71da5
Fix comment to reflect reality
2017-04-19 12:42:47 -07:00
Michael Schurter
745ad9521f
Move ScriptExecutor to driver
2017-04-19 12:42:47 -07:00
Michael Schurter
926d141532
Fix shutdown when consul is down
2017-04-19 12:42:47 -07:00
Michael Schurter
87b28cfb75
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
244251490a
Add UpdateTask method instead of Remove/Add
2017-04-19 12:42:47 -07:00
Michael Schurter
8118c41931
Remove some lies
2017-04-19 12:42:47 -07:00
Michael Schurter
0143bef8c7
Remove unused syncInterval
2017-04-19 12:42:47 -07:00
Michael Schurter
e204a287ed
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
9798e7c7c1
Add SyncNow test
2016-12-02 16:44:18 -08:00
Michael Schurter
92f579891c
Remove lie from comment
2016-11-18 11:05:22 -08:00
Michael Schurter
fc1f557a36
Fix incorrect lock usage around consul maps
2016-11-18 10:12:02 -08:00
Michael Schurter
da9a8bbcef
Fix SyncNow
2016-11-18 10:12:02 -08:00
Michael Schurter
57e5e03ccc
New chaos test to exercise consul syncer
2016-11-18 10:12:02 -08:00
Michael Schurter
393efe2579
Switch syncer tests to use embedded consul
2016-11-15 10:22:25 -08:00
Diptanu Choudhury
7367d6adb4
Removing warn msg
2016-09-04 17:22:49 -07:00
Michael Schurter
ec96e03563
Query consul without helpers in test to be safe
2016-08-31 14:14:17 -07:00
Michael Schurter
aa8cbe777a
Make comment more precise
2016-08-31 10:43:55 -07:00
Michael Schurter
7f6b5f4d2a
Fix error message when querying consul fails
2016-08-31 10:42:51 -07:00
Michael Schurter
db1cf6385e
Assert syncer state is consistent with consul's state
2016-08-31 09:19:54 -07:00
Michael Schurter
f6bf81270d
Remove extra consul service tracking entirely
...
Instead just remove all associated services on shutdown.
2016-08-30 17:10:15 -07:00
Michael Schurter
27912a95d6
Fix old services not getting removed from consul on update
...
Fixes #1661
2016-08-30 16:36:42 -07:00
capone
ce4d236a40
Fixed CR defects
2016-08-24 01:33:44 +03:00
capone
10cc50ad29
First attemt to fix issue #1636
2016-08-23 19:09:20 +03:00
Diptanu Choudhury
4683aa3dc6
Cleaning up some code
2016-08-16 15:22:26 -07:00
Marin
69bc3a8fc8
Add support for initial check status
2016-08-16 12:05:15 -07:00
David Bresson
7d0fb58f03
Add a test for query string support
2016-08-11 12:22:46 -07:00
David Bresson
c651cbbfd6
Add error handling to check registration
2016-08-11 11:49:48 -07:00
David Bresson
f47a543a4d
Add support for query strings in check paths
2016-08-11 11:27:29 -07:00
Alex Dadgar
c203885352
consul syncer uses multi-error
2016-08-09 12:24:50 -07:00
Diptanu Choudhury
48b9684b1e
Using net.JoinHostPort instead of handcrafting addrs
2016-07-08 16:45:14 -07:00
Diptanu Choudhury
b180223f4b
Allowing ports to be overriden in check definitions
2016-07-08 14:14:25 -07:00