mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 16:11:23 +00:00
ipn/ipnlocal: handle untagging nodes better
We would end up with duplicate profiles for the node as the UserID would have chnaged. In order to correctly deduplicate profiles, we need to look at both the UserID and the NodeID. A single machine can only ever have 1 profile per NodeID and 1 profile per UserID. Note: UserID of a Node can change when the node is tagged/untagged, and the NodeID of a device can change when the node is deleted so we need to check for both. Updates #713 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -38,6 +38,7 @@ type Persist struct {
|
||||
LoginName string
|
||||
UserProfile tailcfg.UserProfile
|
||||
NetworkLockKey key.NLPrivate
|
||||
NodeID tailcfg.StableNodeID
|
||||
}
|
||||
|
||||
// PublicNodeKey returns the public key for the node key.
|
||||
@@ -68,7 +69,8 @@ func (p *Persist) Equals(p2 *Persist) bool {
|
||||
p.Provider == p2.Provider &&
|
||||
p.LoginName == p2.LoginName &&
|
||||
p.UserProfile == p2.UserProfile &&
|
||||
p.NetworkLockKey.Equal(p2.NetworkLockKey)
|
||||
p.NetworkLockKey.Equal(p2.NetworkLockKey) &&
|
||||
p.NodeID == p2.NodeID
|
||||
}
|
||||
|
||||
func (p *Persist) Pretty() string {
|
||||
|
Reference in New Issue
Block a user