Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Bind the native History fixture after router construction

pulse-triage[bot]0f082c8f3517
diff --git a/internal/api/truenas_disk_history_integration_test.go b/internal/api/truenas_disk_history_integration_test.go
index 2425c3bbbf..adf3add64d 100644
--- a/internal/api/truenas_disk_history_integration_test.go
+++ b/internal/api/truenas_disk_history_integration_test.go
@@ -157,6 +157,9 @@ func TestTrueNASDiskHistoryAuthenticatedRoute(t *testing.T) {
mtm := monitoring.NewMultiTenantMonitor(cfg, nil, nil)
setUnexportedField(t, mtm, "monitors", map[string]*monitoring.Monitor{"org-a": monitor, "org-b": {}})
router.mtMonitor = mtm
+ // Bind the declared native provider after the constructor installs its
+ // runtime owners, using the same setter/tenant initializer as production.
+ router.setMonitorSupplementalRecordsProvider(unifiedresources.SourceTrueNAS, poller)
maxPoints := ""
request := func(raw, org, metric string) *httptest.ResponseRecorder {
req := httptest.NewRequest(http.MethodGet, "/api/metrics-store/history?resourceType=disk&resourceId=disk-serial&metric="+metric+"&range=1h&maxPoints="+maxPoints, nil)