Skip to content

Commit

Permalink
Calculate resourceCounts from perClusterResourceCounts
Browse files Browse the repository at this point in the history
  • Loading branch information
aruiz14 committed Jan 30, 2025
1 parent 265ab6c commit 6fedbb1
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions shell/models/fleet.cattle.io.gitrepo.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,7 @@ export default class GitRepo extends SteveModel {
return {};
}

return this.bundleDeployments
.filter((bd) => FleetUtils.clusterIdFromBundleDeploymentLabels(bd.metadata?.labels) === clusterId)
.map((bd) => FleetUtils.resourcesFromBundleDeploymentStatus(bd.status))
.flat()
.map((r) => r.state)
.reduce((prev, state) => {
if (!prev[state]) {
prev[state] = 0;
}
prev[state]++;
prev.desiredReady++;

return prev;
}, { desiredReady: 0 });
return this.status?.perClusterResourceCounts[clusterId] || { desiredReady: 0 };
}

get resourcesStatuses() {
Expand Down

0 comments on commit 6fedbb1

Please sign in to comment.