From 593b3ad9816ee8fdf9efa01f53d66ac90949544a Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 30 Jul 2023 19:56:11 +0200 Subject: [PATCH] filter out peers without endpoints Signed-off-by: Kristoffer Dalby --- hscontrol/mapper/mapper.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hscontrol/mapper/mapper.go b/hscontrol/mapper/mapper.go index eddba472..1b6219a0 100644 --- a/hscontrol/mapper/mapper.go +++ b/hscontrol/mapper/mapper.go @@ -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