Skip to content

Commit

Permalink
only send LastSeen if not online
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Sep 28, 2023
1 parent 25f1f4b commit f9d1cb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hscontrol/mapper/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ func tailNode(

PrimaryRoutes: primaryPrefixes,

LastSeen: node.LastSeen,
Online: &online,
KeepAlive: true,
MachineAuthorized: !node.IsExpired(),

Expand All @@ -143,5 +141,14 @@ func tailNode(
},
}

// TODO(kradalby): .Online is only available from capVer 18.
if online {
tNode.Online = &online
} else {
// LastSeen is only set when node is
// not connected to the control server.
tNode.LastSeen = node.LastSeen
}

return &tNode, nil
}

0 comments on commit f9d1cb6

Please sign in to comment.