mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +00:00
filter out peers without endpoints
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
e90a669951
commit
593b3ad981
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue