From 2f4ae27ab30cda3f3cc6a58181d83e5b64b4e56d Mon Sep 17 00:00:00 2001 From: Sebastien Michel Date: Thu, 22 Aug 2024 16:43:46 +0200 Subject: [PATCH] fix: update peers on node update --- pkg/controllers/routing/bgp_peers.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/controllers/routing/bgp_peers.go b/pkg/controllers/routing/bgp_peers.go index ca78775c95..d31343a7b5 100644 --- a/pkg/controllers/routing/bgp_peers.go +++ b/pkg/controllers/routing/bgp_peers.go @@ -207,7 +207,8 @@ func (nrc *NetworkRoutingController) syncInternalPeers() { // connectToExternalBGPPeers adds all the configured eBGP peers (global or node specific) as neighbours func (nrc *NetworkRoutingController) connectToExternalBGPPeers(server *gobgp.BgpServer, peerNeighbors []*gobgpapi.Peer, bgpGracefulRestart bool, bgpGracefulRestartDeferralTime time.Duration, bgpGracefulRestartTime time.Duration, - peerMultihopTTL uint8) error { + peerMultihopTTL uint8, +) error { for _, n := range peerNeighbors { neighborIPStr := n.Conf.NeighborAddress neighborIP := net.ParseIP(neighborIPStr) @@ -288,7 +289,8 @@ func (nrc *NetworkRoutingController) connectToExternalBGPPeers(server *gobgp.Bgp // Does validation and returns neighbor configs func newGlobalPeers(ips []net.IP, ports []uint32, asns []uint32, passwords []string, localips []string, - holdtime float64, localAddress string) ([]*gobgpapi.Peer, error) { + holdtime float64, localAddress string, +) ([]*gobgpapi.Peer, error) { peers := make([]*gobgpapi.Peer, 0) // Validations @@ -377,6 +379,7 @@ func (nrc *NetworkRoutingController) newNodeEventHandler() cache.ResourceEventHa }, UpdateFunc: func(oldObj, newObj interface{}) { // we are only interested in node add/delete, so skip update + nrc.OnNodeUpdate(newObj) }, DeleteFunc: func(obj interface{}) { node, ok := obj.(*v1core.Node)