filter out peers without endpoints

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2023-07-30 19:56:11 +02:00 committed by Kristoffer Dalby
parent e90a669951
commit 593b3ad981
1 changed files with 4 additions and 2 deletions

View File

@ -409,9 +409,11 @@ func (m *Mapper) PeerChangedResponse(
return nil, err return nil, err
} }
// Filter out peers that have expired.
changed = lo.Filter(changed, func(item types.Machine, index int) bool { 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 // If there are filter rules present, see if there are any machines that cannot