From f541acb0ecf9279a12bf017018b7f50858c28c48 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 11 Apr 2016 14:53:18 -0700 Subject: [PATCH] Makes a detached copy of the tags when doing the override. --- command/agent/local.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/command/agent/local.go b/command/agent/local.go index 3447b6ef6e..ed67258c53 100644 --- a/command/agent/local.go +++ b/command/agent/local.go @@ -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}