Skip to content

Commit

Permalink
Merge pull request #1786 from manuelbuil/master
Browse files Browse the repository at this point in the history
Add ipv6-only support for extension backend
  • Loading branch information
manuelbuil committed Jul 26, 2023
2 parents 50adac7 + a701796 commit 84f0f8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pkg/backend/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,18 @@ func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGr
}

attrs := lease.LeaseAttrs{
PublicIP: ip.FromIP(be.extIface.ExtAddr),
BackendType: "extension",
BackendData: data,
}

if be.extIface.IfaceAddr != nil {
attrs.PublicIP = ip.FromIP(be.extIface.IfaceAddr)
}

if be.extIface.IfaceV6Addr != nil {
attrs.PublicIPv6 = ip.FromIP6(be.extIface.IfaceV6Addr)
}

lease, err := be.sm.AcquireLease(ctx, &attrs)
switch err {
case nil:
Expand Down
5 changes: 4 additions & 1 deletion pkg/subnet/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ func (ksm *kubeSubnetManager) AcquireLease(ctx context.Context, attrs *lease.Lea
}
}

if (attrs.BackendType == "vxlan" && string(v6Bd) != "null") || (attrs.BackendType == "wireguard" && string(v6Bd) != "null" && attrs.PublicIPv6 != nil) || (attrs.BackendType == "host-gw" && attrs.PublicIPv6 != nil) {
if (attrs.BackendType == "vxlan" && string(v6Bd) != "null") ||
(attrs.BackendType == "wireguard" && string(v6Bd) != "null" && attrs.PublicIPv6 != nil) ||
(attrs.BackendType == "host-gw" && attrs.PublicIPv6 != nil) ||
(attrs.BackendType == "extension" && attrs.PublicIPv6 != nil) {
n.Annotations[ksm.annotations.BackendV6Data] = string(v6Bd)
if n.Annotations[ksm.annotations.BackendPublicIPv6Overwrite] != "" {
if n.Annotations[ksm.annotations.BackendPublicIPv6] != n.Annotations[ksm.annotations.BackendPublicIPv6Overwrite] {
Expand Down

0 comments on commit 84f0f8b

Please sign in to comment.