control/controlclient: accept key if last seen on exist node is absent (#19402)
On some nodes (found via natlab), the existing nodes last seen could be unset. For these cases, we would want to accept the key and write a last seen. This was breaking the cached netmap natlab tests. Updates #12639 Signed-off-by: Claus Lensbøl <claus@tailscale.com>
This commit is contained in:
@@ -717,6 +717,15 @@ func TestUpdateDiscoForNode(t *testing.T) {
|
||||
wantUpdate: true,
|
||||
wantKeyChanged: false,
|
||||
},
|
||||
{
|
||||
name: "no_initial_last_seen",
|
||||
initialOnline: false,
|
||||
updateDiscoKey: true,
|
||||
updateOnline: false,
|
||||
updateLastSeen: time.Now(),
|
||||
wantUpdate: true,
|
||||
wantKeyChanged: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -736,7 +745,9 @@ func TestUpdateDiscoForNode(t *testing.T) {
|
||||
Key: key.NewNode().Public(),
|
||||
DiscoKey: oldKey.Public(),
|
||||
Online: &tt.initialOnline,
|
||||
LastSeen: &tt.initialLastSeen,
|
||||
}
|
||||
if !tt.initialLastSeen.IsZero() {
|
||||
node.LastSeen = &tt.initialLastSeen
|
||||
}
|
||||
|
||||
if nm := ms.netmapForResponse(&tailcfg.MapResponse{
|
||||
|
||||
Reference in New Issue
Block a user