Skip to content

Commit

Permalink
Node IP handler: do not exclude keepalived vips
Browse files Browse the repository at this point in the history
Previous changes in PR #4040 added a new constraint
to not include keepalived vips in an external func
even though we filtered node IPs within node IP handler.

Remove the external func which filters addresses
and keep the filtering logic within node ip handler
code.

Signed-off-by: Martin Kennelly <mkennell@redhat.com>
(cherry picked from commit 0dddfd8)
  • Loading branch information
martinkennelly committed Mar 28, 2024
1 parent 6699b80 commit 8ad99d7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions go-controller/pkg/node/node_ip_handler_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ func (c *addressManager) sync() {
return
}
for _, link := range links {
foundAddrs, err := util.GetFilteredInterfaceAddrs(link, config.IPv4Mode, config.IPv6Mode)
foundAddrs, err := netlink.AddrList(link, getSupportedIPFamily())
if err != nil {
klog.Errorf("Unable to retrieve addresses for link %s: %v", link.Attrs().Name, err)
klog.Errorf("Failed sync due to being unable to list addresses for %q: %v", link.Attrs().Name, err)
return
}
addrs = append(addrs, foundAddrs...)
Expand Down Expand Up @@ -496,3 +496,13 @@ func updateOVNEncapIPAndReconnect(newIP net.IP) {
return
}
}

func getSupportedIPFamily() int {
var ipFamily int // value of 0 means include both IP v4 and v6 addresses
if config.IPv4Mode && !config.IPv6Mode {
ipFamily = netlink.FAMILY_V4
} else if !config.IPv4Mode && config.IPv6Mode {
ipFamily = netlink.FAMILY_V6
}
return ipFamily
}

0 comments on commit 8ad99d7

Please sign in to comment.