EnableTagOverride doesn't work during *check*-sync
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
### All my nodes are servers
### `consul version`
Consul v0.6.4
Consul Protocol: 3 (Understands back to: 1)
### `consul info` for both Client and Server
```
agent:
check_monitors = 8
check_ttls = 60
checks = 68
services = 69
build:
prerelease =
revision = 26a0ef8c
version = 0.6.4
consul:
bootstrap = true
known_datacenters = 1
leader = true
server = true
raft:
applied_index = 48755
commit_index = 48755
fsm_pending = 0
last_contact = never
last_log_index = 48755
last_log_term = 1
last_snapshot_index = 43150
last_snapshot_term = 1
num_peers = 2
state = Leader
term = 1
runtime:
arch = amd64
cpu_count = 12
goroutines = 328
max_procs = 12
os = linux
version = go1.6
serf_lan:
encrypted = false
event_queue = 0
event_time = 2
failed = 0
intent_queue = 0
left = 0
member_time = 9
members = 3
query_queue = 0
query_time = 1
serf_wan:
encrypted = false
event_queue = 0
event_time = 1
failed = 0
intent_queue = 0
left = 0
member_time = 1
members = 1
query_queue = 0
query_time = 1
```
### Operating system and Environment details
CentOS Linux release 7.0.1406 (Core)
### Description of the Issue (and unexpected/desired result)
Hi
I'm trying to change the tags of a service "from outside" (i.e. through the catalog) using the EnableTagOverride feature.
I've read the good explanation of @slackpad about how EnableTagOverride works during service sync.
https://github.com/hashicorp/consul/issues/1572#issuecomment-170155251
However, it seems that if, after I change the tag on the catalog, a **check-sync** happens before a service-sync, then the check-sync copies the agent's tags into the catalog - like the behavior of a service **without** EnableTagOverride.
Thanks in advance,
Motty
### Reproduction steps
1. Register a service using the agent (PUT v1/agent/service/register) with enableTagOverride=True and Tags=["orig"], and with a health check (Here I use TTL, but I saw it also with a script check)
2. Change the tags using the catalog (PUT v1/catalog/register) with {"Node":..., "Address":..., "Service": {"Id":..., "Tags": ["new"] }}
3. From time to time, read the service's tags both on the agent and the catalog (GET v1/agent/services, GET v1/catalog/service/). You will see "new" in the catalog but "orig" on the agent.
4. Change the health check status (v1/agent/check/warn) to induce syncing the check.
**Actual result**: The tag "orig" on the agent remains, and is also copied to the catalog.
**Expected result**: The tag "new" should remain in the catalog, and be copied to the agent.
**Note**: If you skip step 4 (or don't do it fast enough), a periodic service-sync occurs, and it yields the expected result.
### Log Fragments or Link to gist
I used `-log-level=TRACE` but then cut out the boring parts..
https://gist.github.com/motty-stratoscale/521c57bca424169ebf38b3917f9e37df
Contributor guide
Assessment
This issue has not been assessed yet.