mirror of https://github.com/status-im/consul.git
acfd87c673
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. |
||
---|---|---|
.. | ||
acl.go | ||
acl_cache.go | ||
acl_cache_test.go | ||
acl_legacy.go | ||
acl_legacy_test.go | ||
acl_test.go | ||
catalog.go | ||
check_definition.go | ||
check_definition_test.go | ||
check_type.go | ||
connect.go | ||
connect_ca.go | ||
connect_ca_test.go | ||
connect_proxy_config.go | ||
connect_proxy_config_test.go | ||
connect_test.go | ||
errors.go | ||
intention.go | ||
intention_test.go | ||
operator.go | ||
prepared_query.go | ||
prepared_query_test.go | ||
sanitize_oss.go | ||
service_definition.go | ||
service_definition_test.go | ||
snapshot.go | ||
structs.go | ||
structs_test.go | ||
testing_catalog.go | ||
testing_connect_proxy_config.go | ||
testing_intention.go | ||
testing_service_definition.go | ||
txn.go |