From 0436dd1f26caaf2efce43d6da78d9ef68ad51a65 Mon Sep 17 00:00:00 2001 From: Dong Chen Date: Tue, 22 Mar 2016 14:10:57 -0700 Subject: [PATCH] An endpoint is duplicate/stale if its ID is part of endpoint index. Signed-off-by: Dong Chen --- cluster/network.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/network.go b/cluster/network.go index 9663a0af99..addf5d0c90 100644 --- a/cluster/network.go +++ b/cluster/network.go @@ -91,7 +91,7 @@ func (network *Network) RemoveDuplicateEndpoints() *Network { // if this endpointID doesn't exist yet, add it // if this endpointID exists, but endpointIndex is not a duplicate, use // this endpointIndex - if _, ok := endpointMap[endpointID]; !ok || !strings.HasPrefix(endpointIndex, "ep-") { + if _, ok := endpointMap[endpointID]; !ok || !strings.Contains(endpointIndex, endpointID) { endpointMap[endpointID] = endpointIndex } }