consul/agent/structs
Matt Keeler acfd87c673
Improve Connect with Prepared Queries (#5291)
Given a query like:

```
{
   "Name": "tagged-connect-query",
   "Service": {
      "Service": "foo",
      "Tags": ["tag"],
      "Connect": true
   }
}
```

And a Consul configuration like:

```
{
   "services": [
      "name": "foo",
      "port": 8080,
      "connect": { "sidecar_service": {} },
      "tags": ["tag"]
   ]
}
```

If you executed the query it would always turn up with 0 results. This was because the sidecar service was being created without any tags. You could instead make your config look like:

```
{
   "services": [
      "name": "foo",
      "port": 8080,
      "connect": { "sidecar_service": {
         "tags": ["tag"]
      } },
      "tags": ["tag"]
   ]
}
```

However that is a bit redundant for most cases. This PR ensures that the tags and service meta of the parent service get copied to the sidecar service. If there are any tags or service meta set in the sidecar service definition then this copying does not take place. After the changes, the query will now return the expected results.

A second change was made to prepared queries in this PR which is to allow filtering on ServiceMeta just like we allow for filtering on NodeMeta.
2019-02-04 09:36:51 -05:00
..
acl.go Disregard rules when set on a management token (#5261) 2019-01-23 15:48:38 -05:00
acl_cache.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_cache_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_legacy.go acl: add stub hooks to support some plumbing in enterprise (#4951) 2018-11-13 15:35:54 -06:00
acl_legacy_test.go New ACLs (#4791) 2018-10-19 12:04:07 -04:00
acl_test.go Disregard rules when set on a management token (#5261) 2019-01-23 15:48:38 -05:00
catalog.go agent: remove ConnectProxyServiceName 2018-06-14 09:41:49 -07:00
check_definition.go agent: fix formatting 2018-11-07 02:16:03 -08:00
check_definition_test.go agent: fix formatting 2018-11-07 02:16:03 -08:00
check_type.go agent/structs: check is alias if node is empty 2018-07-12 09:36:11 -07:00
connect.go Proxy Config Manager (#4729) 2018-10-10 16:55:34 +01:00
connect_ca.go connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
connect_ca_test.go connect: tame thundering herd of CSRs on CA rotation (#5228) 2019-01-22 17:19:36 +00:00
connect_proxy_config.go Proxy Config Manager (#4729) 2018-10-10 16:55:34 +01:00
connect_proxy_config_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
connect_test.go Added connect proxy config and local agent state setup on boot. 2018-06-14 09:41:57 -07:00
errors.go Implement /v1/agent/health/service/<service name> endpoint (#3551) 2019-01-07 09:39:23 -05:00
intention.go fsm: add Intention operations to transactions for internal use 2018-10-19 10:02:28 -07:00
intention_test.go agent/consul: set precedence value on struct itself 2018-06-25 12:24:16 -07:00
operator.go Move autopilot to a standalone package 2017-12-11 16:45:33 -08:00
prepared_query.go Improve Connect with Prepared Queries (#5291) 2019-02-04 09:36:51 -05:00
prepared_query_test.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
sanitize_oss.go acl: add stub hooks to support some plumbing in enterprise (#4951) 2018-11-13 15:35:54 -06:00
service_definition.go merge feedback: fix typos; actually use deliverLatest added previously but not plumbed in 2018-10-10 16:55:34 +01:00
service_definition_test.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
snapshot.go agent: move agent/consul/structs to agent/structs 2017-08-09 14:32:12 +02:00
structs.go simpler fix 2019-01-24 17:12:08 +01:00
structs_test.go correct name 2019-01-25 11:00:56 +01:00
testing_catalog.go Add SidecarService Syntax sugar to Service Definition (#4686) 2018-10-10 16:55:34 +01:00
testing_connect_proxy_config.go Add -sidecar-for and new /agent/service/:service_id endpoint (#4691) 2018-10-10 16:55:34 +01:00
testing_intention.go agent: use testing intention to get valid intentions 2018-06-14 09:41:43 -07:00
testing_service_definition.go Add Proxy Upstreams to Service Definition (#4639) 2018-10-10 16:55:34 +01:00
txn.go txn: update existing txn api docs with new operations 2019-01-15 16:54:07 -08:00