mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-27 18:27:47 +00:00
filter out peers without endpoints
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
e90a669951
commit
593b3ad981
@ -409,9 +409,11 @@ func (m *Mapper) PeerChangedResponse(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Filter out peers that have expired.
|
||||
changed = lo.Filter(changed, func(item types.Machine, index int) bool {
|
||||
return !item.IsExpired()
|
||||
// Filter out nodes that are expired OR
|
||||
// nodes that has no endpoints, this typically means they have
|
||||
// registered, but are not configured.
|
||||
return !item.IsExpired() || len(item.Endpoints) > 0
|
||||
})
|
||||
|
||||
// If there are filter rules present, see if there are any machines that cannot
|
||||
|
Loading…
x
Reference in New Issue
Block a user