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

swap add and remove gateways in hostPool.go

parent ce3a797a
Branches
Tags
No related merge requests found
......@@ -314,14 +314,6 @@ func (h *HostPool) updateConns() error {
return errors.Errorf("Unable to convert new NDF to set: %+v", err)
}
// Handle removing Gateways
for gwId := range h.ndfMap {
if _, ok := newMap[gwId]; !ok {
// If GwId in ndfMap is not in newMap, remove the Gateway
h.removeGateway(gwId.DeepCopy())
}
}
// Handle adding Gateways
for gwId, ndfIdx := range newMap {
if _, ok := h.ndfMap[gwId]; !ok {
......@@ -330,6 +322,14 @@ func (h *HostPool) updateConns() error {
}
}
// Handle removing Gateways
for gwId := range h.ndfMap {
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.
Please register or to comment