mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
feat(license): remove untrusted devices from node count [EE-5357] (#8817)
This commit is contained in:
parent
5f6ddc2fad
commit
cfed481d6e
7 changed files with 102 additions and 35 deletions
|
@ -2,13 +2,16 @@ package status
|
|||
|
||||
import (
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/internal/endpointutils"
|
||||
)
|
||||
|
||||
// NodesCount returns the total node number of all environments
|
||||
func NodesCount(endpoints []portainer.Endpoint) int {
|
||||
nodes := 0
|
||||
for _, env := range endpoints {
|
||||
nodes += countNodes(&env)
|
||||
if !endpointutils.IsEdgeEndpoint(&env) || env.UserTrusted {
|
||||
nodes += countNodes(&env)
|
||||
}
|
||||
}
|
||||
|
||||
return nodes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue