Skip to content
Snippets Groups Projects
Commit 1c9c3d3f authored by Jake Taylor's avatar Jake Taylor
Browse files

fix hostpool index bug

parent 96e7109d
No related branches found
No related tags found
2 merge requests!53Release,!51fix hostpool index bug
......@@ -581,24 +581,27 @@ func (h *HostPool) updateConns() error {
// Filter out gateway IDs
newMap = h.getFilter()(newMap, h.ndf)
// Keep track of the old NDF set
oldMap := h.ndfMap
// Update the internal NDF set
h.ndfMap = newMap
// Handle adding Gateways
for gwId, ndfIdx := range newMap {
if _, ok := h.ndfMap[gwId]; !ok {
if _, ok := oldMap[gwId]; !ok {
// If GwId in newMap is not in ndfMap, add the Gateway
h.addGateway(gwId.DeepCopy(), ndfIdx)
}
}
// Handle removing Gateways
for gwId := range h.ndfMap {
for gwId := range oldMap {
if _, ok := newMap[gwId]; !ok {
// If GwId in ndfMap is not in newMap, remove the Gateway
h.removeGateway(gwId.DeepCopy())
}
}
// Update the internal NDF set
h.ndfMap = newMap
return nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment