Makes a detached copy of the tags when doing the override.

This commit is contained in:
James Phillips 2016-04-11 14:53:18 -07:00
parent 50e1d661ad
commit 422adaf168
1 changed files with 5 additions and 2 deletions

View File

@ -394,9 +394,12 @@ func (l *localState) setSyncState() error {
continue
}
// If our definition is different, we need to update it
// If our definition is different, we need to update it. Make a
// copy so that we don't retain a pointer to any actual state
// store info for in-memory RPCs.
if existing.EnableTagOverride {
existing.Tags = service.Tags
existing.Tags = make([]string, len(service.Tags))
copy(existing.Tags, service.Tags)
}
equal := existing.IsSame(service)
l.serviceStatus[id] = syncStatus{inSync: equal}