Skip to content
Snippets Groups Projects
Commit b8191b71 authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'hotfix/HostPoolIndexBug' into 'release'

fix hostpool index bug

See merge request !51
parents 96e7109d 1c9c3d3f
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 { ...@@ -581,24 +581,27 @@ func (h *HostPool) updateConns() error {
// Filter out gateway IDs // Filter out gateway IDs
newMap = h.getFilter()(newMap, h.ndf) 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 // Handle adding Gateways
for gwId, ndfIdx := range newMap { 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 // If GwId in newMap is not in ndfMap, add the Gateway
h.addGateway(gwId.DeepCopy(), ndfIdx) h.addGateway(gwId.DeepCopy(), ndfIdx)
} }
} }
// Handle removing Gateways // Handle removing Gateways
for gwId := range h.ndfMap { for gwId := range oldMap {
if _, ok := newMap[gwId]; !ok { if _, ok := newMap[gwId]; !ok {
// If GwId in ndfMap is not in newMap, remove the Gateway // If GwId in ndfMap is not in newMap, remove the Gateway
h.removeGateway(gwId.DeepCopy()) h.removeGateway(gwId.DeepCopy())
} }
} }
// Update the internal NDF set
h.ndfMap = newMap
return nil 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