Skip to content

Commit

Permalink
skip node OnUpdate events (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsykim authored and murali-reddy committed Apr 13, 2018
1 parent 6ba2e94 commit 945a13c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/controllers/network_routes_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1716,17 +1716,19 @@ func (nrc *NetworkRoutingController) newNodeEventHandler() cache.ResourceEventHa
nodeIP, _ := utils.GetNodeIP(node)

glog.V(2).Infof("Received node %s added update from watch API so peer with new node", nodeIP)
nrc.OnNodeUpdate(obj)
},
UpdateFunc: func(oldObj, newObj interface{}) {
nrc.OnNodeUpdate(newObj)
// we are interested only node add/delete, so skip update
return

},
DeleteFunc: func(obj interface{}) {
node := obj.(*v1core.Node)
nodeIP, _ := utils.GetNodeIP(node)

glog.Infof("Received node %s removed update from watch API, so remove node from peer", nodeIP)

nrc.OnNodeUpdate(obj)
},
}
}
Expand Down

0 comments on commit 945a13c

Please sign in to comment.