Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update peers on node update #1723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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