Skip to content

Commit

Permalink
Fixes #24665: Number of nodes in rule badge is not correct with tenants
Browse files Browse the repository at this point in the history
  • Loading branch information
fanf committed Apr 3, 2024
1 parent 5f7b785 commit e988d7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,15 @@ object RuleTarget extends Loggable {
// here, if we don't find the group, we consider it's an error in the
// target recording, but don't fail, just log it.
case GroupTarget(groupId) =>
nodes ++ groups.getOrElse(groupId, Chunk.empty)
val groupNodes = groups.getOrElse(groupId, Chunk.empty)
val filtered = {
if (allNodesAreThere) groupNodes
else {
val keys = Chunk.fromIterable(allNodes.keys)
groupNodes.filter(keys.contains(_))
}
}
nodes ++ filtered

case TargetIntersection(targets) =>
val nodeSets = targets.map(t => getNodeIdsChunkRec(Chunk(t), allNodes, groups, allNodesAreThere))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ object RoNodeGroupRepository {
targets: Set[RuleTarget],
arePolicyServers: MapView[NodeId, Boolean]
): Chunk[NodeId] = {
RuleTarget.getNodeIdsChunk(targets, arePolicyServers, allGroups)
RuleTarget.getNodeIdsChunk(targets, arePolicyServers, allGroups, false)
}
}

Expand Down

0 comments on commit e988d7e

Please sign in to comment.