mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-29 15:23:45 +00:00
This reverts commit 6a93b17c8cafc1d8e1c52e133511e52ed9086355. The reverted commit added more complexity than it was worth at the current stage. Handling delta CapVer changes requires extensive changes to relayManager datastructures in order to also support delta updates of relay servers. Updates tailscale/corp#27502 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
e92eb6b17b
commit
583f740c0b
@ -69,17 +69,6 @@ func (m NodeMutationLastSeen) Apply(n *tailcfg.Node) {
|
||||
n.LastSeen = ptr.To(m.LastSeen)
|
||||
}
|
||||
|
||||
// NodeMutationCap is a NodeMutation that says a node's
|
||||
// [tailcfg.CapabilityVersion] value has changed.
|
||||
type NodeMutationCap struct {
|
||||
mutatingNodeID
|
||||
Cap tailcfg.CapabilityVersion
|
||||
}
|
||||
|
||||
func (m NodeMutationCap) Apply(n *tailcfg.Node) {
|
||||
n.Cap = m.Cap
|
||||
}
|
||||
|
||||
var peerChangeFields = sync.OnceValue(func() []reflect.StructField {
|
||||
var fields []reflect.StructField
|
||||
rt := reflect.TypeFor[tailcfg.PeerChange]()
|
||||
@ -116,8 +105,6 @@ func NodeMutationsFromPatch(p *tailcfg.PeerChange) (_ []NodeMutation, ok bool) {
|
||||
ret = append(ret, NodeMutationOnline{mutatingNodeID(p.NodeID), *p.Online})
|
||||
case "LastSeen":
|
||||
ret = append(ret, NodeMutationLastSeen{mutatingNodeID(p.NodeID), *p.LastSeen})
|
||||
case "Cap":
|
||||
ret = append(ret, NodeMutationCap{mutatingNodeID(p.NodeID), p.Cap})
|
||||
}
|
||||
}
|
||||
return ret, true
|
||||
|
@ -177,14 +177,6 @@ func TestMutationsFromMapResponse(t *testing.T) {
|
||||
},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
name: "patch-cap",
|
||||
mr: fromChanges(&tailcfg.PeerChange{
|
||||
NodeID: 1,
|
||||
Cap: 2,
|
||||
}),
|
||||
want: muts(NodeMutationCap{1, 2}),
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@ -203,7 +195,6 @@ func TestMutationsFromMapResponse(t *testing.T) {
|
||||
NodeMutationDERPHome{},
|
||||
NodeMutationOnline{},
|
||||
NodeMutationLastSeen{},
|
||||
NodeMutationCap{},
|
||||
)); diff != "" {
|
||||
t.Errorf("wrong result (-want +got):\n%s", diff)
|
||||
}
|
||||
|
@ -3263,10 +3263,6 @@ func (c *Conn) onNodeMutationsUpdate(update NodeMutationsUpdate) {
|
||||
ep.mu.Lock()
|
||||
ep.setEndpointsLocked(views.SliceOf(m.Endpoints))
|
||||
ep.mu.Unlock()
|
||||
case netmap.NodeMutationCap:
|
||||
ep.mu.Lock()
|
||||
ep.relayCapable = capVerIsRelayCapable(m.Cap)
|
||||
ep.mu.Unlock()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user