mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-18 07:47:28 +02:00
[management] Check groups when counting peers on networks list (#3284)
This commit is contained in:
parent
ca9aca9b19
commit
cee4aeea9e
@ -7,6 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
s "github.com/netbirdio/netbird/management/server"
|
s "github.com/netbirdio/netbird/management/server"
|
||||||
"github.com/netbirdio/netbird/management/server/groups"
|
"github.com/netbirdio/netbird/management/server/groups"
|
||||||
@ -281,7 +282,12 @@ func (h *handler) collectIDsInNetwork(ctx context.Context, accountID, userID, ne
|
|||||||
}
|
}
|
||||||
if len(router.PeerGroups) > 0 {
|
if len(router.PeerGroups) > 0 {
|
||||||
for _, groupID := range router.PeerGroups {
|
for _, groupID := range router.PeerGroups {
|
||||||
peerCounter += len(groups[groupID].Peers)
|
group, ok := groups[groupID]
|
||||||
|
if !ok {
|
||||||
|
log.WithContext(ctx).Warnf("group %s not found", groupID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
peerCounter += len(group.Peers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user