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

Support vxlan mode of Calico #402

Merged
merged 1 commit into from
Jul 28, 2023
Merged
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
13 changes: 10 additions & 3 deletions pkg/connector/routing/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,18 @@ func getFlannelLocalPrefixes() (lp4, lp6 []string, err error) {
}

func getCalicoLocalPrefixes() (lp4, lp6 []string, err error) {
tunl, err := netlink.LinkByName("tunl0")
var device netlink.Link
device, err = netlink.LinkByName("vxlan.calico")
if err != nil {
return nil, nil, err
logger.Error(err, "failed to get device vxlan.calico, trying tunl0.")
device, err = netlink.LinkByName("tunl0")
if err != nil {
logger.Error(err, "failed to find calico interface.")
return nil, nil, err
}
}

addrs, err := netlink.AddrList(tunl, netlink.FAMILY_ALL)
addrs, err := netlink.AddrList(device, netlink.FAMILY_ALL)
if err != nil {
return nil, nil, err
}
Expand All @@ -141,6 +147,7 @@ func getCalicoLocalPrefixes() (lp4, lp6 []string, err error) {
lp6 = append(lp6, ipNet.String())
}
}
logger.Info("Calico IP address: IPv4 = " + strings.Join(lp4, ",") + ", IPv6 = " + strings.Join(lp6, ","))

return lp4, lp6, nil
}
Expand Down
Loading