cmd/natc: add optional consensus backend
Enable nat connector to be run on a cluster of machines for high availability. Updates #14667 Signed-off-by: Fran Bull <fran@tailscale.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"net/netip"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go4.org/netipx"
|
||||
"tailscale.com/tailcfg"
|
||||
@@ -19,7 +20,7 @@ func TestIPPoolExhaustion(t *testing.T) {
|
||||
var ipsb netipx.IPSetBuilder
|
||||
ipsb.AddPrefix(smallPrefix)
|
||||
addrPool := must.Get(ipsb.IPSet())
|
||||
pool := IPPool{IPSet: addrPool}
|
||||
pool := SingleMachineIPPool{IPSet: addrPool}
|
||||
|
||||
assignedIPs := make(map[netip.Addr]string)
|
||||
|
||||
@@ -68,7 +69,7 @@ func TestIPPool(t *testing.T) {
|
||||
var ipsb netipx.IPSetBuilder
|
||||
ipsb.AddPrefix(netip.MustParsePrefix("100.64.1.0/24"))
|
||||
addrPool := must.Get(ipsb.IPSet())
|
||||
pool := IPPool{
|
||||
pool := SingleMachineIPPool{
|
||||
IPSet: addrPool,
|
||||
}
|
||||
from := tailcfg.NodeID(12345)
|
||||
@@ -89,7 +90,7 @@ func TestIPPool(t *testing.T) {
|
||||
t.Errorf("IPv4 address %s not in range %s", addr, addrPool)
|
||||
}
|
||||
|
||||
domain, ok := pool.DomainForIP(from, addr)
|
||||
domain, ok := pool.DomainForIP(from, addr, time.Now())
|
||||
if !ok {
|
||||
t.Errorf("domainForIP(%s) not found", addr)
|
||||
} else if domain != "example.com" {
|
||||
|
||||
Reference in New Issue
Block a user