Frank Schroeder
67cdfc038e
Revert "local state: fix anti-entropy state tests"
...
This reverts commit f8e20cd996
.
2017-10-23 10:08:34 +02:00
Frank Schroeder
fca0df59fb
Revert "agent: skip non-sensical TestCatalogRegister"
...
This reverts commit ce1f35373e
.
2017-10-23 10:08:34 +02:00
Frank Schroeder
556bf3f85d
Revert "local state: drop retry loops from tests"
...
This reverts commit 2bdba8ab06
.
2017-10-23 10:08:34 +02:00
Frank Schroeder
a3aa864d5b
Revert "local state: rename tests"
...
This reverts commit ff62eaf063
.
2017-10-23 10:08:34 +02:00
Frank Schroeder
39615cb57b
Revert "local state: fix TestAgentAntiEntropy_EnableTagOverride"
...
This reverts commit 86f7ea6013
.
2017-10-23 10:08:34 +02:00
Frank Schroeder
9fdea75d99
Revert "local state: refactor TestAgentAntiEntropy_EnableTagOverride"
...
This reverts commit c28e23eac8
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
46641e44d9
Revert "local state: address review comments"
...
This reverts commit 1d315075b1
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
abd83f2d28
Revert "local state: update comments"
...
This reverts commit 42188164f8
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
c6e441dd60
Revert "local state: update documentation of updateSyncState"
...
This reverts commit e86521e637
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
648b4da4f8
Revert "local state: move Metadata methods together"
...
This reverts commit 9bc8127728
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
fa45a6a547
Revert "local state: rename Add{Check,Service}State to Set{Check,Service}State"
...
This reverts commit 9280841a80
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
e95d22b9a8
Revert "ae: ensure that syncs are blocked when paused"
...
This reverts commit ffb265dd93
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
23a9ac9d56
Revert "ae: restore previous pause/resume behavior"
...
This reverts commit 126046be23
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
93d03595d1
Revert "ae: make stagger function pluggable for testing"
...
This reverts commit 066ad01c38
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
3d202b59bc
Revert "ae: add test for ifNotPausedRun"
...
This reverts commit f5177ef332
.
2017-10-23 10:08:33 +02:00
Frank Schroeder
e0e96496f1
Revert "ae: add test for resume triggering SyncChanges"
...
This reverts commit cd0262744d
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
cab3b17292
Revert "ae: fix typo in constructor name"
...
This reverts commit e88f49e2cc
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
25ed78c8f7
Revert "ae: make control flow more explicit"
...
This reverts commit b9a8b53d52
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
65166cce8e
Revert "ae: add test that we run a full before a partial sync"
...
This reverts commit 8158cec829
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
e78520c3f9
Revert "ae: refactor StateSyncer to state machine for better testing"
...
This reverts commit 8a45365f68
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
4121cafed7
Revert "ae: add remaining test cases"
...
This reverts commit c32915bb4f
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
f8202f300f
Revert "ae: do not trigger on Resume while holding the lock"
...
This reverts commit bd00814301
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
d6f52d9ed1
Revert "local state: use synchronized access to internal maps"
...
This reverts commit 39a2d8d25e
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
4e862d126d
Revert "local state: clone check to avoid side effect"
...
This reverts commit af1243c725
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
42af4cdc70
Revert "local state: make test more robust"
...
This reverts commit f9267380db
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
4ae8317fbf
Revert "local state: remove stale comment"
...
This reverts commit 35f4acdddc
.
2017-10-23 10:08:32 +02:00
Frank Schroeder
eb0f2036a3
Revert "config: document telemetry options"
...
This reverts commit 7fede4472d
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
63402a3103
Revert "config: document http options"
...
This reverts commit 5f59857448
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
721cb8d561
Revert "config: document dns options"
...
This reverts commit 5e57e9273e
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
f3ed813f03
Revert "config: document autopilot options"
...
This reverts commit 7685ef409c
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
c4662e4806
Revert "config: document acl options"
...
This reverts commit 7396bd31fd
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
807831446a
Revert "config: document config options"
...
This reverts commit a38c69d784
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
29616e969a
Revert "config: document more acl options"
...
This reverts commit 2682ce0b82
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
3667a882ef
Revert "config: document more config options"
...
This reverts commit bf81cdea6e
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
522dce2602
Revert "config: document more config options"
...
This reverts commit 9864609201
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
22f3c7cb0a
Revert "config: document remaining config options"
...
This reverts commit 0ed4561f12
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
0693082d40
Revert "config: address review comments"
...
This reverts commit f6e9ad99ec
.
2017-10-23 10:08:31 +02:00
Frank Schroeder
223fae7d92
Revert "fix go vet issue"
...
This reverts commit 078e50b635
.
2017-10-23 10:00:26 +02:00
Frank Schröder
6aa9372792
Revert "config: rename test struct field to args"
...
This reverts commit f2a291a470
.
2017-10-23 09:58:37 +02:00
Frank Schröder
1073de49db
Revert "config: return error on extra command line arguments ( #3397 )"
...
This reverts commit ce935cef55
.
2017-10-23 09:58:37 +02:00
Frank Schroeder
078e50b635
fix go vet issue
2017-10-23 08:13:52 +02:00
Frank Schroeder
ce935cef55
config: return error on extra command line arguments ( #3397 )
...
The `consul agent` command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an `=` when setting
boolean flags to `true`. `-bootstrap true` is not the same as
`-bootstrap=true`, for example.
Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.
Fixes #3397
2017-10-23 08:08:09 +02:00
Frank Schroeder
f2a291a470
config: rename test struct field to args
2017-10-23 08:08:09 +02:00
Frank Schroeder
b97ab367f4
config: return error on extra command line arguments ( #3397 )
...
The `consul agent` command was ignoring extra command line arguments
which can lead to confusion when the user has for example forgotten to
add a dash in front of an argument or is not using an `=` when setting
boolean flags to `true`. `-bootstrap true` is not the same as
`-bootstrap=true`, for example.
Since all command line flags are known and we don't expect unparsed
arguments we can return an error. However, this may make it slightly
more difficult in the future if we ever wanted to have these kinds of
arguments.
Fixes #3397
2017-10-23 08:07:48 +02:00
Frank Schroeder
1fef7f4b67
config: rename test struct field to args
2017-10-23 08:07:48 +02:00
Frank Schroeder
f6e9ad99ec
config: address review comments
2017-10-23 08:06:26 +02:00
Frank Schroeder
0ed4561f12
config: document remaining config options
2017-10-23 08:06:26 +02:00
Frank Schroeder
9864609201
config: document more config options
2017-10-23 08:06:26 +02:00
Frank Schroeder
bf81cdea6e
config: document more config options
2017-10-23 08:06:26 +02:00
Frank Schroeder
2682ce0b82
config: document more acl options
2017-10-23 08:06:26 +02:00
Frank Schroeder
a38c69d784
config: document config options
2017-10-23 08:06:26 +02:00
Frank Schroeder
7396bd31fd
config: document acl options
2017-10-23 08:06:26 +02:00
Frank Schroeder
7685ef409c
config: document autopilot options
2017-10-23 08:06:26 +02:00
Frank Schroeder
5e57e9273e
config: document dns options
2017-10-23 08:06:26 +02:00
Frank Schroeder
5f59857448
config: document http options
2017-10-23 08:06:26 +02:00
Frank Schroeder
7fede4472d
config: document telemetry options
2017-10-23 08:06:26 +02:00
Frank Schroeder
21a7d399bd
config: address review comments
2017-10-23 08:05:47 +02:00
Frank Schroeder
cf0a571a76
config: document remaining config options
2017-10-23 08:04:03 +02:00
Frank Schroeder
149ab13a13
config: document more config options
2017-10-23 08:04:03 +02:00
Frank Schroeder
a8f709a875
config: document more config options
2017-10-23 08:04:03 +02:00
Frank Schroeder
6c64cf9b5d
config: document more acl options
2017-10-23 08:04:03 +02:00
Frank Schroeder
ffb0f6ec8b
config: document config options
2017-10-23 08:04:03 +02:00
Frank Schroeder
70270d6d98
config: document acl options
2017-10-23 08:04:03 +02:00
Frank Schroeder
7f214b1e1c
config: document autopilot options
2017-10-23 08:04:03 +02:00
Frank Schroeder
cfc891fc25
config: document dns options
2017-10-23 08:04:03 +02:00
Frank Schroeder
d27617c60b
config: document http options
2017-10-23 08:04:03 +02:00
Frank Schroeder
625713dd72
config: document telemetry options
2017-10-23 08:04:03 +02:00
Frank Schroeder
35f4acdddc
local state: remove stale comment
2017-10-23 08:03:18 +02:00
Frank Schroeder
f9267380db
local state: make test more robust
2017-10-23 08:03:18 +02:00
Frank Schroeder
af1243c725
local state: clone check to avoid side effect
2017-10-23 08:03:18 +02:00
Frank Schroeder
39a2d8d25e
local state: use synchronized access to internal maps
2017-10-23 08:03:18 +02:00
Frank Schroeder
bd00814301
ae: do not trigger on Resume while holding the lock
2017-10-23 08:03:18 +02:00
Frank Schroeder
c32915bb4f
ae: add remaining test cases
2017-10-23 08:03:18 +02:00
Frank Schroeder
8a45365f68
ae: refactor StateSyncer to state machine for better testing
2017-10-23 08:03:18 +02:00
Frank Schroeder
8158cec829
ae: add test that we run a full before a partial sync
2017-10-23 08:03:18 +02:00
Frank Schroeder
b9a8b53d52
ae: make control flow more explicit
2017-10-23 08:03:18 +02:00
Frank Schroeder
e88f49e2cc
ae: fix typo in constructor name
2017-10-23 08:03:18 +02:00
Frank Schroeder
cd0262744d
ae: add test for resume triggering SyncChanges
2017-10-23 08:03:18 +02:00
Frank Schroeder
f5177ef332
ae: add test for ifNotPausedRun
2017-10-23 08:03:18 +02:00
Frank Schroeder
066ad01c38
ae: make stagger function pluggable for testing
2017-10-23 08:03:18 +02:00
Frank Schroeder
126046be23
ae: restore previous pause/resume behavior
2017-10-23 08:03:18 +02:00
Frank Schroeder
ffb265dd93
ae: ensure that syncs are blocked when paused
2017-10-23 08:03:18 +02:00
Frank Schroeder
9280841a80
local state: rename Add{Check,Service}State to Set{Check,Service}State
2017-10-23 08:03:18 +02:00
Frank Schroeder
9bc8127728
local state: move Metadata methods together
2017-10-23 08:03:18 +02:00
Frank Schroeder
e86521e637
local state: update documentation of updateSyncState
2017-10-23 08:03:18 +02:00
Frank Schroeder
42188164f8
local state: update comments
2017-10-23 08:03:18 +02:00
Frank Schroeder
1d315075b1
local state: address review comments
...
* move non-blocking notification mechanism into ae.Trigger
* move Pause/Resume into separate type
2017-10-23 08:03:18 +02:00
Frank Schroeder
c28e23eac8
local state: refactor TestAgentAntiEntropy_EnableTagOverride
...
Make intent clearer by being more explicit and adding some comments.
Use verify.Values to compare service entries.
2017-10-23 08:03:18 +02:00
Frank Schroeder
86f7ea6013
local state: fix TestAgentAntiEntropy_EnableTagOverride
...
The test had a race condition where it relied on the first service to be
synced to the remote catalog which sometimes failed.
2017-10-23 08:03:18 +02:00
Frank Schroeder
ff62eaf063
local state: rename tests
2017-10-23 08:03:18 +02:00
Frank Schroeder
2bdba8ab06
local state: drop retry loops from tests
...
Since the tests are now using synchronous calls for state syncing
we no longer need to use retry loops to wait for the changes to
propagate.
2017-10-23 08:03:18 +02:00
Frank Schroeder
ce1f35373e
agent: skip non-sensical TestCatalogRegister
...
It is not clear what this test is supposed to verify.
2017-10-23 08:03:18 +02:00
Frank Schroeder
f8e20cd996
local state: fix anti-entropy state tests
...
The anti-entropy tests relied on the side-effect of the StartSync()
method to perform a full sync instead of a partial sync. This lead to
multiple anti-entropy go routines being started unnecessary retry loops.
This change changes the behavior to perform synchronous full syncs when
necessary removing the need for all of the time.Sleep and most of the
retry loops.
2017-10-23 08:03:18 +02:00
Frank Schroeder
e9149f64d9
local state: fix test with updated error message
2017-10-23 08:03:18 +02:00
Frank Schroeder
76682da4a0
local state: fix failing tests
2017-10-23 08:03:18 +02:00
Frank Schroeder
1af52bf7be
local state: tests compile
2017-10-23 08:03:18 +02:00
Frank Schroeder
ccbae7da5b
local state: replace multi-map state with structs
...
The state of the service and health check records was spread out over
multiple maps guarded by a single lock. Access to the maps has to happen
in a coordinated effort and the tests often violated this which made
them brittle and racy.
This patch replaces the multiple maps with a single one for both checks
and services to make the code less fragile.
This is also necessary since moving the local state into its own package
creates circular dependencies for the tests. To avoid this the tests can
no longer access internal data structures which they should not be doing
in the first place.
The tests still don't compile but this is a ncessary step in that
direction.
2017-10-23 08:03:18 +02:00
Frank Schroeder
d447e823c6
local state: move to separate package
...
This patch moves the local state to a separate package to further
decouple it from the agent code.
The code compiles but the tests do not yet.
2017-10-23 08:03:18 +02:00
Frank Schroeder
b5dbad910c
agent: simplify some loops
2017-10-23 08:03:18 +02:00
Frank Schroeder
7a2af206ea
agent: refactor sync loop to linear flow of control
2017-10-23 08:03:18 +02:00