Add isEphemeral() method to Machine

This commit is contained in:
Juan Font 2022-12-27 11:30:59 +00:00
parent 6db9656008
commit 4de49f5f49
2 changed files with 7 additions and 2 deletions

View file

@ -153,6 +153,12 @@ func (machine *Machine) isOnline() bool {
return machine.LastSeen.After(time.Now().Add(-keepAliveInterval))
}
// isEphemeral returns if the machine is registered as an Ephemeral node.
// https://tailscale.com/kb/1111/ephemeral-nodes/
func (machine *Machine) isEphemeral() bool {
return machine.AuthKey != nil && machine.AuthKey.Ephemeral
}
func containsAddresses(inputs []string, addrs []string) bool {
for _, addr := range addrs {
if containsStr(inputs, addr) {