Remove database from Mapper
This commit changes the internals of the mapper to track all the changes to peers over its lifetime. This means that it no longer depends on the database and this should hopefully help with locks and timing issues. When the mapper is created, it needs the current list of peers, the world view, when the polling session was started. Then as update changes are called, it tracks the changes and generates responses based on its internal list. As a side, the types.Machines and types.MachinesP, as well as types.Machine being passed as a full struct and pointer has been changed to always be pointers, everywhere. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
3b0749a320
commit
387aa03adb
15 changed files with 251 additions and 236 deletions
|
@ -45,7 +45,7 @@ func TestTailNode(t *testing.T) {
|
|||
|
||||
tests := []struct {
|
||||
name string
|
||||
machine types.Machine
|
||||
machine *types.Machine
|
||||
pol *policy.ACLPolicy
|
||||
dnsConfig *tailcfg.DNSConfig
|
||||
baseDomain string
|
||||
|
@ -54,7 +54,7 @@ func TestTailNode(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "empty-machine",
|
||||
machine: types.Machine{},
|
||||
machine: &types.Machine{},
|
||||
pol: &policy.ACLPolicy{},
|
||||
dnsConfig: &tailcfg.DNSConfig{},
|
||||
baseDomain: "",
|
||||
|
@ -63,7 +63,7 @@ func TestTailNode(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "minimal-machine",
|
||||
machine: types.Machine{
|
||||
machine: &types.Machine{
|
||||
ID: 0,
|
||||
MachineKey: "mkey:f08305b4ee4250b95a70f3b7504d048d75d899993c624a26d422c67af0422507",
|
||||
NodeKey: "nodekey:9b2ffa7e08cc421a3d2cca9012280f6a236fd0de0b4ce005b30a98ad930306fe",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue