Commit Graph

6545 Commits

Author SHA1 Message Date
Frank Schroeder a11f3bb52b build: drop 'consul' build tag for OSS build 2017-08-30 13:40:18 +02:00
Frank Schroeder 62c77d70f0 build: make tests independent of build tags
When the metadata server is scanning the agents for potential servers
it is parsing the version number which the agent provided when it
joined. This version number has to conform to a certain format, i.e.
'n.n.n'. Without this version number properly set some tests fail with
error messages that disguise the root cause.

The default version number is currently set to 'unknown' in
version/version.go which does not parse and triggers the tests to fail.
The work around is to use a build tag 'consul' which will use the
version number set in version_base.go instead which has the correct
format and is set to the current release version.

In addition, some parts of the code also require the version number to
be of a certain value. Setting it to '0.0.0' for example makes some
tests pass and others fail since they don't pass the semantic check.

When using go build/install/test one has to remember to use '-tags
consul' or tests will fail with non-obvious error messages.

Using build tags makes the build process more complex and error prone
since it prevents the use of the plain go toolchain and - at least in
its current form - introduces subtle build and test issues. We should
try to eliminate build tags for anything else but platform specific
code.

This patch removes all references to specific version numbers in the
code and tests and sets the default version to '9.9.9' which is
syntactically correct and passes the semantic check. This solves the
issue of running go build/install/test without tags for the OSS build.
2017-08-30 13:40:18 +02:00
James Phillips 230f1b2333
Updates the change log. 2017-08-29 15:33:48 -07:00
James Phillips 513a3c51ff Merge pull request #3428 from hashicorp/go-1.9
Upgrades Go version to 1.9.
2017-08-29 15:33:04 -07:00
James Phillips 77521e40a8
Upgrades Go version to 1.9. 2017-08-29 15:32:34 -07:00
Brian Shumate 9f0900c97d API DOCS: Update snapshot curl example (#3423) 2017-08-29 09:05:00 -07:00
Frank Schroeder 2190a4fb71
doc: document that retry-join values are URL encoded
Fixes #3417
2017-08-26 15:19:43 +02:00
Frank Schroeder b7c3c8756d
doc: fix parameter name for aws retry-join
Fixes #3417
2017-08-26 15:19:34 +02:00
James Phillips 520dbd1838 Update CHANGELOG.md 2017-08-25 00:14:44 -07:00
Preetha Appan 9419990855 Updating CHANGELOG 2017-08-24 16:50:22 -05:00
preetapan 4166517c50 Merge pull request #3416 from hashicorp/issue_3409
Update raft library for windows snapshot fsync fixes. 

This fixes #3409
2017-08-24 16:46:06 -05:00
Preetha Appan 2514523920 Update raft library for windows snapshot fsync fixes. This fixes #3409 2017-08-24 16:44:05 -05:00
James Phillips c558067783 Update CHANGELOG.md 2017-08-23 14:37:39 -07:00
Frank Schroeder 4dea401e8f
Update CHANGELOG.md 2017-08-23 22:40:43 +02:00
Frank Schroeder 84a1bf0a99 agent: drop status code comments 2017-08-23 22:36:23 +02:00
Frank Schroeder b06584f631 agent: use http.StatusRequestEntityTooLarge instead of 413 2017-08-23 22:36:23 +02:00
Frank Schroeder cc83590962 agent: use http.StatusInternalServerError instead of 500 2017-08-23 22:36:23 +02:00
Frank Schroeder bf426beb45 agent: use http.StatusMethodNotAllowed instead of 405 2017-08-23 22:36:23 +02:00
Frank Schroeder 0c3534cbf7 agent: use http.StatusNotFound instead of 404 2017-08-23 22:36:23 +02:00
Frank Schroeder 970a7f97ec agent: use http.StatusForbidden instead of 403 2017-08-23 22:36:23 +02:00
Frank Schroeder 2e586be5aa agent: use http.StatusUnauthorized instead of 401 2017-08-23 22:36:23 +02:00
Frank Schroeder 923f8e2364 agent: use http.StatusBadRequest instead of 400 2017-08-23 22:36:23 +02:00
Frank Schroeder 0e246054ef doc: document cloud auto-joining for retry-join-wan 2017-08-23 21:23:34 +02:00
Frank Schroeder a32eab5923 agent: support go-discover retry-join for wan 2017-08-23 21:23:34 +02:00
Frank Schroeder 509e667f94 vendor: upgrade github.com/hashicorp/go-discover
Pull in improved debug logging for AWS
2017-08-23 21:23:34 +02:00
Frank Schroeder a99f9f8778
doc: fix operator keyring delete method 2017-08-23 17:20:10 +02:00
Frank Schröder 44e6b8122d acl: consolidate error handling (#3401)
The error handling of the ACL code relies on the presence of certain
magic error messages. Since the error values are sent via RPC between
older and newer consul agents we cannot just replace the magic values
with typed errors and switch to type checks since this would break
compatibility with older clients.

Therefore, this patch moves all magic ACL error messages into the acl
package and provides default error values and helper functions which
determine the type of error.
2017-08-23 16:52:48 +02:00
James Phillips 828dec4df6 Update CHANGELOG.md 2017-08-21 15:31:40 -07:00
James Phillips 586dc3c7f4 Update CHANGELOG.md 2017-08-21 15:31:24 -07:00
Frank Schroeder d9e2a51887 agent: drop unused code
This code from http://github.com/hashicorp/consul/pull/3353 is no longer
required.
2017-08-22 00:02:46 +02:00
Frank Schroeder 4bfcf7b613 dns: replace nameserver lookup with consistent rpc call
This patch replaces the code which determines the list of servers in the
current cluster with an RPC call to get the list of active consul
service instances which only run on servers.

This replaces the previous implementation which was more complex and
relied on serf messages which can provide a different view than the
consistent response from the raft log.

As a side effect it makes the implementation independent of the server
and the agent which means it works consistently across both. Different
behavior for server and agent was the root cause for the bug in
http://github.com/hashicorp/consul/issue/3047.

Fixes #3407
2017-08-22 00:02:46 +02:00
Frank Schroeder 8e1f9b9b68 dns: split node lookup from request handling 2017-08-22 00:02:46 +02:00
Frank Schroeder db8ad8922e dns: refactor label by unrolling loop 2017-08-22 00:02:46 +02:00
Frank Schroeder c35206db07 dns: move ttl closer to usage 2017-08-22 00:02:46 +02:00
Preetha Appan e1181e3dac Update CHANGELOG.md 2017-08-18 11:22:35 -05:00
preetapan b098b074e4 Merge pull request #3395 from Illirgway/patch-1
Fix bug with unused (replaced with "") CONSUL_HTTP_AUTH in some places

This fixes #3392
2017-08-18 11:18:24 -05:00
preetapan f20ddcba4e Merge pull request #3404 from zevin/master
Added configuration instructions for forwarding DNS queries from Unbound
2017-08-18 10:29:39 -05:00
Kevin Bidwell 8a53f556f9 Added configuration instructions for forwarding DNS queries from Unbound to consul. 2017-08-18 08:45:43 -06:00
Preetha Appan 040f8ae775 Update serf to pick up fixes for fsyncing snapshots and panic when coordinates are disabled 2017-08-17 16:35:06 -05:00
Frank Schroeder 10491407d5
doc: update check example for agent api call 2017-08-16 18:24:28 +02:00
Frank Schröder a895d3b832 doc: add method and header to agent API docs for HTTP checks (#3400) 2017-08-16 18:18:46 +02:00
Preetha Appan 9419cecb1d Update CHANGELOG.md 2017-08-16 09:39:10 -05:00
preetapan 327292d809 Merge pull request #3396 from hashicorp/memberlist_deadlock
Update memberlist for a deadlock fix
2017-08-15 18:08:40 -05:00
Preetha Appan 40d6e1fbc7 Update memberlist for a deadlock fix 2017-08-15 18:07:28 -05:00
Illirgway 46915108e7 Fix bug with unused (replaced with "") CONSUL_HTTP_AUTH in some places
example: https://github.com/hashicorp/consul/blob/master/watch/plan.go#L26

	conf := consulapi.DefaultConfig()
	conf.Address = address
	conf.Datacenter = p.Datacenter
	conf.Token = p.Token                             # <-- replace Token from DefaultConfig/CONSUL_HTTP_AUTH with ""
	client, err := consulapi.NewClient(conf)

how to reproduce bug:
0. consul -> localhost:8500 with more than 0 service checks
1. deny all for anonymous token
2. create appropriate acl <token> for watch checks (agent:read + node:read,service:read)
3. bash:
CONSUL_HTTP_AUTH=<token> consul watch -http-addr=localhost:8500 -type=checks # --> return []
consul watch -http-addr=localhost:8500 -type=checks -token=<token> # -> return { .... right json result .... }
2017-08-16 01:51:18 +03:00
Frank Schröder fd4bf4070e doc: retry_join is a string array (#3388) 2017-08-10 09:58:26 +02:00
wuxin 792a535c87 fix command/kv_import.go help text (#3387) 2017-08-10 09:17:37 +02:00
James Phillips 48b1afeb26 Removes partial details in the retry_join config file section. (#3386) 2017-08-09 21:27:17 -07:00
Seth Vargo b6f4df4b03 Document the new auto-join in the config and CLI (#3381)
* Document the new auto-join in the config and CLI
* Mention and example DNS
2017-08-09 21:14:56 -07:00
James Phillips 843acdaa9b Adds a note about the 429 response code. 2017-08-09 20:10:44 -07:00