Skip to content

Commit

Permalink
fix: update peers on node update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebltm committed Aug 22, 2024
1 parent 01747ce commit 2f4ae27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controllers/routing/bgp_peers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2f4ae27

Please sign in to comment.