filter golden image volume count in dashboard (#332) (#333)

(cherry picked from commit d4d3774c3b62b9759f78898b5b74990203912992)

Signed-off-by: Andy Lee <andy.lee@suse.com>
Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
mergify[bot] 2025-06-10 12:37:52 +08:00 committed by GitHub
parent 18a53f5baf
commit 9f0d927c9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,6 +132,7 @@ export default {
const hash = {
vms: this.fetchClusterResources(HCI.VM),
pvcs: this.fetchClusterResources(PVC),
nodes: this.fetchClusterResources(NODE),
events: this.fetchClusterResources(EVENT),
metricNodes: this.fetchClusterResources(METRIC.NODE),
@ -221,6 +222,7 @@ export default {
nodes: [],
metricNodes: [],
vms: [],
pvcs: [],
monitoring: {},
VM_DASHBOARD_METRICS_URL,
CLUSTER_METRICS_SUMMARY_URL,
@ -285,6 +287,14 @@ export default {
out[resource.type].name = this.t(`typeLabel."${ resource.spoofed.name }"`, { count: out[resource.type].total });
}
if (resource.type === PVC) {
// filter out the golden image volumes
const goldenImageVolumeCount = (this.pvcs || []).filter((pvc) => pvc.isGoldenImageVolume).length;
out[resource.type].useful = out[resource.type].useful - goldenImageVolumeCount;
out[resource.type].total = out[resource.type].total - goldenImageVolumeCount;
}
if (resource.type === HCI.BLOCK_DEVICE) {
let total = 0;
let errorCount = 0;