Fixes#4673
Supercedes: #5677
There was an error decoding `map[string]string` values due to Go strings being immutable. This was fixes in our go-msgpack fork.
Due to an unintended order of operations issue with integer division
TestSessionTTLRenew was sleeping for 0s every time.
Also add explicit failures for when the various session renewal returns
nil unexpectedly.
Fixes: #4222
# Data Filtering
This PR will implement filtering for the following endpoints:
## Supported HTTP Endpoints
- `/agent/checks`
- `/agent/services`
- `/catalog/nodes`
- `/catalog/service/:service`
- `/catalog/connect/:service`
- `/catalog/node/:node`
- `/health/node/:node`
- `/health/checks/:service`
- `/health/service/:service`
- `/health/connect/:service`
- `/health/state/:state`
- `/internal/ui/nodes`
- `/internal/ui/services`
More can be added going forward and any endpoint which is used to list some data is a good candidate.
## Usage
When using the HTTP API a `filter` query parameter can be used to pass a filter expression to Consul. Filter Expressions take the general form of:
```
<selector> == <value>
<selector> != <value>
<value> in <selector>
<value> not in <selector>
<selector> contains <value>
<selector> not contains <value>
<selector> is empty
<selector> is not empty
not <other expression>
<expression 1> and <expression 2>
<expression 1> or <expression 2>
```
Normal boolean logic and precedence is supported. All of the actual filtering and evaluation logic is coming from the [go-bexpr](https://github.com/hashicorp/go-bexpr) library
## Other changes
Adding the `Internal.ServiceDump` RPC endpoint. This will allow the UI to filter services better.
* Docker based builds can now use the module cache
* Simplify building the consul-dev docker image.
* Make sure to pull the latest consul image.
* Allow selecting base image version for the dev image
* build: use only version tags in version output now api is tagged too
Fixes#5621
Since we now have api package tags, our build tooling was picking up api tag when working out version to bake into builds.
This fixes it by restricting to only tags that start with `v`.
Before:
```
$ make version
Version: 1.4.4
Version + release: 1.4.4-dev
Version + git: api/v1.0.1-90-g3ce60db0c
Version + release + git: api/v1.0.1-90-g3ce60db0c-dev (3ce60db0c)
```
After:
```
$ make version
Version: 1.4.4
Version + release: 1.4.4-dev
Version + git: v1.4.4-126-g3ce60db0c
Version + release + git: v1.4.4-126-g3ce60db0c-dev (3ce60db0c)
```
* Update GNUmakefile
* [docs] security warning about Helm chart
Correct security warning about helm chart to caution about default Consul install.
* clarify that k8s or consul should be secure
* terraform: remove modules in repo
These are not currently being maintained and tested, and were
created prior to the existence of the Terraform Module Registry,
which is the more appropriate way to share and distribute modules.
In an effort to limit confusion of the purpose of these modules and
not encourage usage of something we aren't confident about, this
removes them from this repository.
You can still access these modules if you depend on them by pinning to
a specific ref in Git.
It is recommended you pin against a recent major version where
these modules existed:
```
module "consul-aws" {
source = "git::https://github.com/hashicorp/consul.git//terraform/aws?ref=v1.4.0"
}
```
More detail about module sources can be found on this page:
https://www.terraform.io/docs/modules/sources.html
* terraform: add a readme for anyone who can't find the modules