Skip to content

Commit

Permalink
Fix dangling IPs in address pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Oct 24, 2024
1 parent 5c0d9cd commit 62a71fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/controllers/loadbalancer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ type Config struct {
}

func (cfg *Config) ComputeAddressPools(ips []*models.V1IPResponse, nws sets.Set[string]) error {
cfg.AddressPools = nil

var errs []error
for _, ip := range ips {
if !nws.Has(*ip.Networkid) {
klog.Infof("skipping ip %q: not part of cluster networks", *ip.Ipaddress)
continue
}

klog.Infof("adding ip to pool %s", *ip.Ipaddress)

net := *ip.Networkid
err := cfg.addIPToPool(net, *ip)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions pkg/controllers/loadbalancer/metallb/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"time"

"github.com/davecgh/go-spew/spew"
"github.com/metal-stack/metal-ccm/pkg/controllers/loadbalancer"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -122,9 +121,6 @@ func (cfg *metalLBConfig) WriteCRs(ctx context.Context, c client.Client) error {
AutoAssign: pool.AutoAssign,
}

klog.Info("writing address pool")
spew.Dump(ipAddressPool.Spec)

return nil
})
if err != nil {
Expand Down

0 comments on commit 62a71fe

Please sign in to comment.