Skip to content

Commit

Permalink
vendor: metallb bump
Browse files Browse the repository at this point in the history
this patch bumps our metallb fork to the necessary version to support
podcidr announcements.

Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
Co-authored-by: Chris Tarazi <chris@isovalent.com>
  • Loading branch information
2 people authored and kkourt committed Oct 26, 2021
1 parent e4ecee3 commit 25b985c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
Binary file added bpf/cilium-map-migrate
Binary file not shown.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ replace (
github.com/miekg/dns => github.com/cilium/dns v1.1.4-0.20190417235132-8e25ec9a0ff3
github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b

go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20210609003938-62cef75b3c9f
go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20210831235406-48667b93284d

// Using private fork of controller-tools. See commit msg for more context
// as to why we are using a private fork.
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 16 additions & 6 deletions vendor/go.universe.tf/metallb/pkg/speaker/bgp_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (

type peer struct {
cfg *config.Peer
bgp session
bgp Session
}

type BGPController struct {
Expand Down Expand Up @@ -227,11 +227,11 @@ func (c *BGPController) updateAds() error {
// and detecting conflicting advertisements.
allAds = append(allAds, ads...)
}
for _, peer := range c.peers {
if peer.bgp == nil {
for _, session := range c.PeerSessions() {
if session == nil {
continue
}
if err := peer.bgp.Set(allAds...); err != nil {
if err := session.Set(allAds...); err != nil {
return err
}
}
Expand All @@ -246,7 +246,8 @@ func (c *BGPController) DeleteBalancer(l log.Logger, name, reason string) error
return c.updateAds()
}

type session interface {
// Session gives access to the BGP session.
type Session interface {
io.Closer
Set(advs ...*bgp.Advertisement) error
}
Expand All @@ -265,6 +266,15 @@ func (c *BGPController) SetNodeLabels(l log.Logger, lbls map[string]string) erro
return c.syncPeers(l)
}

var newBGP = func(logger log.Logger, addr string, myASN uint32, routerID net.IP, asn uint32, hold time.Duration, password string, myNode string) (session, error) {
// PeerSessions returns the underlying BGP sessions for direct use.
func (c *BGPController) PeerSessions() []Session {
s := make([]Session, len(c.peers))
for i, peer := range c.peers {
s[i] = peer.bgp
}
return s
}

var newBGP = func(logger log.Logger, addr string, myASN uint32, routerID net.IP, asn uint32, hold time.Duration, password string, myNode string) (Session, error) {
return bgp.New(logger, addr, myASN, routerID, asn, hold, password, myNode)
}
9 changes: 9 additions & 0 deletions vendor/go.universe.tf/metallb/pkg/speaker/speaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,15 @@ func (c *Controller) SetNodeLabels(l gokitlog.Logger, labels map[string]string)
return types.SyncStateSuccess
}

// PeerSessions returns the underlying BGP sessions from the BGP controller. In
// Layer2 mode only, this returns nil.
func (c *Controller) PeerSessions() []Session {
if handler, ok := c.protocols[config.BGP]; ok {
return handler.(*BGPController).PeerSessions()
}
return nil
}

// Endpoints represents an object containing the minimal representation of a
// v1.Endpoints similar to Service.
type Endpoints struct {
Expand Down
6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ go.uber.org/zap/internal/color
go.uber.org/zap/internal/exit
go.uber.org/zap/zapcore
go.uber.org/zap/zapgrpc
# go.universe.tf/metallb v0.10.0 => github.com/cilium/metallb v0.1.1-0.20210609003938-62cef75b3c9f
## explicit; go 1.16
# go.universe.tf/metallb v0.10.0 => github.com/cilium/metallb v0.1.1-0.20210831235406-48667b93284d
## explicit; go 1.17
go.universe.tf/metallb/pkg/allocator
go.universe.tf/metallb/pkg/allocator/k8salloc
go.universe.tf/metallb/pkg/bgp
Expand Down Expand Up @@ -1428,5 +1428,5 @@ sigs.k8s.io/structured-merge-diff/v4/value
sigs.k8s.io/yaml
# github.com/miekg/dns => github.com/cilium/dns v1.1.4-0.20190417235132-8e25ec9a0ff3
# github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b
# go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20210609003938-62cef75b3c9f
# go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20210831235406-48667b93284d
# sigs.k8s.io/controller-tools => github.com/christarazi/controller-tools v0.6.2

0 comments on commit 25b985c

Please sign in to comment.