Skip to content

Commit

Permalink
filter out peers without endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Sep 19, 2023
1 parent e90a669 commit 593b3ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hscontrol/mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 593b3ad

Please sign in to comment.