Commit Graph

1369 Commits

Author SHA1 Message Date
Frank Schroeder 9f8f258d4d Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
Frank Schroeder 58c3b1ff38 Use fmt.Fprint/Fprintf/Fprintln
Used the following rewrite rules:

gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b, c, d))) -> fmt.Fprintf(resp, a, b, c, d)' *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b, c))) -> fmt.Fprintf(resp, a, b, c)' *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a, b))) -> fmt.Fprintf(resp, a, b)'  *.go
gofmt -w -r 'resp.Write([]byte(fmt.Sprintf(a))) -> fmt.Fprint(resp, a)' *.go
gofmt -w -r 'resp.Write([]byte(a + "\n")) -> fmt.Fprintln(resp, a)' *.go
gofmt -w -r 'resp.Write([]byte(a)) -> fmt.Fprint(resp, a)' *.go
2017-04-20 09:02:59 -07:00
Kyle Havlovitz 72ee7c2501 Show raft protocol in list-peers command (#2929) 2017-04-19 15:01:40 -07:00
Kyle Havlovitz e97574fc4c
Fix help text on client cert/key options 2017-04-18 16:30:20 -07:00
mckennajones 1695506b1d
Added check to see if ui and ui-dir flags are both specified 2017-04-17 17:25:57 -07:00
Kyle Havlovitz 095b441ed4
Fix help text for -ca-path 2017-04-14 14:44:45 -07:00
Kyle Havlovitz cdd8b5b880
Add tls client options to api/cli 2017-04-14 13:37:29 -07:00
James Phillips 1129827f91 Merge pull request #2842 from vaLski/supress_sigpipe_logging
Supress signal logging on SIGPIPE. Should address #2768
2017-04-13 16:52:29 -07:00
James Phillips 1f40dc83e3
Updates static assets to pick up #2899. 2017-04-13 14:40:16 -07:00
James Phillips 86a69e8207 Merge pull request #2904 from hashicorp/non-host-id
Adds a new -disable-host-node-id option to help when testing with containers.
2017-04-13 10:49:05 -07:00
James Phillips 20bf47d2b4
Adds a new -disable-host-node-id option to help when testing with containers.
Fixes #2877.
2017-04-12 22:07:18 -07:00
Ralph Caraveo c06b72ba17 Fixed spelling for consul kv get command --help comments. 2017-04-12 17:31:57 -07:00
Alex Dadgar 13f026dec4 Hash host ID so its stable and well distributed
This PR takes the host ID and runs it through a hash so that it is well
distributed. This makes it so that machines that report similar host IDs
are easily distinguished.

Instances of similar IDs occur on EC2 where the ID is prefixed and on
motherboards created in the same batch.
2017-04-10 11:57:24 -07:00
James Phillips c7f7e969d7 Merge pull request #2854 from hashicorp/remote-exec
Changes `disable_remote_exec` default to true so remote exec is opt-in.
2017-03-30 10:29:09 -07:00
Kyle Havlovitz a2058d23ef
Add CLI/API endpoints for removing peer by ID 2017-03-30 10:13:32 -07:00
James Phillips ac90110396
Changes `disable_remote_exec` default to true so remote exec is opt-in. 2017-03-30 09:43:32 -07:00
James Phillips 4259ecd8bc
Disables agent-level enforcement on Consul agents unless acl_datacenter is set. 2017-03-29 12:24:42 -07:00
vaLentin chernoZemski 8aee2b805a Supress signal logging on SIGPIPE. Should address #2768
When consul-template is communicating with consul and the job is done, consul thread receives SIGPIPE.

This cause the logs to be filled "Caught signal: broken pipe" and they does not bring any usefull info with them.

Skipping those.
2017-03-29 09:46:58 +03:00
James Phillips 424d70ba5d
Cleans up a stray mark and fixes unit tests.
Ended up removing the leader_test.go server address change test as part
of this. The join was failing becase we were using a new node name with
the new logic here, but realized this was hitting some of the memberlist
conflict logic and not working as we expected. We need some additional
work to fully support address changes, so removed the test for now.
2017-03-27 01:28:54 -07:00
James Phillips dce84379b7
Fixes up some broken unit tests. 2017-03-24 17:35:07 -07:00
James Phillips f2211d2489
Keeps the service and check tokens around for deregistration.
We fixed a few related issues while we were in here. We now only let
services register checks with a matching token, and we also close out
service and check delete operations if the catalog deregister claims
it doesn't know about the ID of the service or check being deleted.
2017-03-24 17:15:20 -07:00
James Phillips c553e1d93a
Changes verson 8 ACLs to opt-out. 2017-03-24 12:12:24 -07:00
Seth Vargo 2efa3bdff8
Use new APIs 2017-03-23 18:48:13 -04:00
Seth Vargo 78bd562f41
Re-add RPC parsing
This makes the upgrade path a bit nicer, since people will likely have
older configurations. This prints out a warning instead of just failing
if the old rpc addr or ports definition is in the config.
2017-03-23 17:10:14 -04:00
James Phillips ab2b615265
Renames some operator unit tests. 2017-03-22 19:26:43 -07:00
Kyle Havlovitz 37ea20cb44
Add advanced autopilot features 2017-03-22 15:25:16 -07:00
James Phillips 36a0abe10f Merge pull request #2801 from hashicorp/spoken-hub-oss
Adds support for WAN soft fail and join flooding.
2017-03-20 16:24:07 -07:00
James Phillips 964a5e2b28
Updates to latest built-in static assets. 2017-03-20 10:18:47 -07:00
James Phillips 43d24b3ba0
Fixes RTT command to only compare coordinates in the same area. 2017-03-16 16:42:19 -07:00
James Phillips 28f8aa5559
Removes remoteConsuls in favor of the new router.
This has the next wave of RTT integration with the router and also
factors some common RTT-related helpers out to lib. While we were
in here we also got rid of the coordinate disable config so we don't
need to deal with the complexity in the router (there was never a
user-visible way to disable coordinates).
2017-03-16 16:42:19 -07:00
Kyle Havlovitz 006c6b93b3 Merge pull request #2802 from hashicorp/f-autopilot-improvements
Fix an issue with changing server ID when re-joining
2017-03-15 20:26:16 -07:00
Kyle Havlovitz bc0494e396
Reorganized cluster health check loop and logic 2017-03-15 18:27:17 -07:00
Kyle Havlovitz c40279e012
Fix an issue with changing server IDs and add a few UX enhancements around autopilot features 2017-03-15 16:09:55 -07:00
James Phillips 9b43b31900
Forces user-supplied node IDs to lower case for consistency. 2017-03-13 19:51:56 -07:00
Kyle Havlovitz b15d67bfac
Use defers for WaitGroup and Ticker stop 2017-03-10 12:29:03 -08:00
Kyle Havlovitz 8130f9b1c1
Cleaned up and reorganized some autopilot-related code 2017-03-09 18:21:40 -08:00
Kyle Havlovitz a7de1e2a3b
Move RaftStats to Status endpoint 2017-03-07 13:58:06 -08:00
Kyle Havlovitz 0606133b75
Merge branch 'master' into f-autopilot-2 2017-03-06 16:02:19 -08:00
Kyle Havlovitz 8bcab6c6d7
Add autopilot server health tracking
This adds two goroutines to perform autopilot tasks on the leader - one
to monitor the health of servers and another to periodically clean up
dead servers with a limit on removal count. Also adds a new http endpoint,
`/v1/operator/autopilot/health`, for querying this information through an
operator RPC endpoint.
2017-03-06 16:00:10 -08:00
Sean Chittenden c6feba6ab7 Revert "Change `ClientAddr` to default to `BindAddr` when not present." 2017-03-06 13:32:43 -08:00
Sean Chittenden e1ced1de30
Change `ClientAddr` to default to `BindAddr` when not present.
With this change, it is now possible to only specify the `-bind` or
`bind_addr` attributes and get a functioning consul agent.
2017-03-04 20:52:52 -08:00
James Phillips aba567273e Merge pull request #2690 from zeroae/f-simple-rfc2782
RFC 2782 support with optional .service tag
2017-03-02 14:49:36 -08:00
Kyle Havlovitz 44f0b08db7 Merge pull request #2771 from hashicorp/f-autopilot
Autopilot dead server cleanup, config, and raft version compatibility
2017-02-28 15:04:16 -08:00
Kyle Havlovitz 77785778bf Merge pull request #2774 from hashicorp/f-cli-deprecation-docs
Add CLI RPC deprecation section to docs
2017-02-28 14:59:48 -08:00
Kyle Havlovitz 23c492a74e
Rename DeadServerCleanup and make wording adjustments 2017-02-28 14:45:21 -08:00
Kyle Havlovitz 01fe3fb399
Fix up command and api tests 2017-02-28 14:12:55 -08:00
Kyle Havlovitz 3b67c50c1d
Remove the RPC client interface and update docs 2017-02-28 13:41:09 -08:00
Sean Chittenden 63402c6eaa
Follow the lead in 6fc901a8f3 and set the default `DisplayName` to `Consul` 2017-02-26 12:26:14 -08:00
Kyle Havlovitz 953baed324
Convert agent command to use base.Command 2017-02-24 18:11:05 -08:00
Kyle Havlovitz f7b6d776f4
Add cli docs and minor test/comment tweaks 2017-02-24 16:55:44 -08:00