mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-22 03:04:03 +00:00
fix: correct storage Instance field to match node.Instance in mock data
Previously, storage Instance fields were set to `fmt.Sprintf("pve-%s", node.Name)`,
creating values like "pve-pve1" that didn't match the parent node's Instance field
("mock-cluster"). This caused storage filtering and counting to fail when matching
by instance + node, similar to the backup/snapshot issue fixed earlier.
Changes:
- Set storage.Instance = node.Instance for local storage (generator.go:862)
- Set storage.Instance = node.Instance for local-zfs storage (generator.go:909)
- Set storage.Instance = node.Instance for random storage (generator.go:934)
- PBS storage already correctly used node.Instance (generator.go:969)
This ensures storage counts display correctly on the Storage tab node summary cards
and that filtering by instance + node works consistently across all resource types.
Note: This is part of the broader pattern fix where all resources must match by
both instance AND node name to handle duplicate hostnames across clusters correctly.
This commit is contained in:
@@ -859,7 +859,7 @@ func generateStorage(nodes []models.Node) []models.Storage {
|
||||
ID: fmt.Sprintf("%s-local", node.Name),
|
||||
Name: "local",
|
||||
Node: node.Name,
|
||||
Instance: fmt.Sprintf("pve-%s", node.Name),
|
||||
Instance: node.Instance,
|
||||
Type: "dir",
|
||||
Status: "available",
|
||||
Total: localTotal,
|
||||
@@ -906,7 +906,7 @@ func generateStorage(nodes []models.Node) []models.Storage {
|
||||
ID: fmt.Sprintf("%s-local-zfs", node.Name),
|
||||
Name: "local-zfs",
|
||||
Node: node.Name,
|
||||
Instance: fmt.Sprintf("pve-%s", node.Name),
|
||||
Instance: node.Instance,
|
||||
Type: "zfspool",
|
||||
Status: "available",
|
||||
Total: zfsTotal,
|
||||
@@ -931,7 +931,7 @@ func generateStorage(nodes []models.Node) []models.Storage {
|
||||
ID: fmt.Sprintf("%s-%s", node.Name, storageName),
|
||||
Name: storageName,
|
||||
Node: node.Name,
|
||||
Instance: fmt.Sprintf("pve-%s", node.Name),
|
||||
Instance: node.Instance,
|
||||
Type: storageType,
|
||||
Status: "available",
|
||||
Total: total,
|
||||
|
||||
Reference in New Issue
Block a user