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.

Keep PMG opt-outs explicit in settings readback

pulse-triage[bot]485299acead9
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 11e5c3b27e..3e57d85af1 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -17,6 +17,10 @@
### PMG scope persistence does not change agent authority
+PMG scope booleans remain explicit when false in shared settings readback,
+so the existing PMG form does not re-enable collection through an omission.
+These dataset options still grant no agent or command authority.
+
Shared node-settings and connection API code now preserves explicit PMG
collection choices via the internal saved-scope discriminator and effective
legacy default. This affects PMG API reads only: no agent enrolment, credential,
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 77d3781787..1f1ce6df28 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -22,6 +22,13 @@
### PMG scope readback preserves explicit all-off settings
+Settings node responses carry explicit false for all four PMG scope booleans,
+including all-off and partial selections. The existing edit form defaults
+omitted mail/queue/quarantine flags to on; `omitempty` must not resurrect an
+opt-out during a later unrelated save. Real GET-payload controls in
+`configapi/pmg_scope_test.go` and `TestContract_PMGFalseScopeIsExplicitOnWire`
+cover this consumer boundary without changing frontend source.
+
Existing node add/update payloads keep their four boolean collection options.
PMG saves persist the internal `monitoringConfigured` discriminator: legacy
all-zero entries retain the existing mail-statistics default, while a saved
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 2dccd38abf..5748bd9017 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -23,6 +23,10 @@
### PMG collection scope remains separate from backup recovery
+PMG settings readback emits explicit false dataset options; absence must not
+re-enable the existing edit form defaults. Backup polling remains independent
+of these mail/queue/quarantine/domain options and requires a pause to stop.
+
Shared node-settings and connections code preserves PMG collection opt-outs
without changing storage identity, capacity, History or recovery semantics.
The four mail/queue/quarantine/domain switches do not disable PMG configuration
diff --git a/internal/api/configapi/config_handlers.go b/internal/api/configapi/config_handlers.go
index 1121ee0fc7..28564758dd 100644
--- a/internal/api/configapi/config_handlers.go
+++ b/internal/api/configapi/config_handlers.go
@@ -907,10 +907,10 @@ type NodeResponse struct {
MonitorPruneJobs bool `json:"monitorPruneJobs,omitempty"`
MonitorGarbageJobs bool `json:"monitorGarbageJobs,omitempty"`
ExcludeDatastores []string `json:"excludeDatastores"` // PBS only
- MonitorMailStats bool `json:"monitorMailStats,omitempty"`
- MonitorQueues bool `json:"monitorQueues,omitempty"`
- MonitorQuarantine bool `json:"monitorQuarantine,omitempty"`
- MonitorDomainStats bool `json:"monitorDomainStats,omitempty"`
+ MonitorMailStats bool `json:"monitorMailStats"`
+ MonitorQueues bool `json:"monitorQueues"`
+ MonitorQuarantine bool `json:"monitorQuarantine"`
+ MonitorDomainStats bool `json:"monitorDomainStats"`
Enabled bool `json:"enabled"` // Lifecycle; false = paused
Status string `json:"status"` // "connected", "disconnected", "error"
IsCluster bool `json:"isCluster,omitempty"`
diff --git a/internal/api/configapi/pmg_scope_test.go b/internal/api/configapi/pmg_scope_test.go
index 890001449b..ca6621ed91 100644
--- a/internal/api/configapi/pmg_scope_test.go
+++ b/internal/api/configapi/pmg_scope_test.go
@@ -42,6 +42,22 @@ func TestPMGCollectionScopeSavedPatch(t *testing.T) {
if len(nodes) != 1 || nodes[0].MonitorMailStats != tc.wantMail || nodes[0].MonitorQueues != tc.queues {
t.Fatalf("readback scope=%+v", nodes)
}
+ // The real settings GET must carry explicit false, not just the
+ // Go value: the existing form defaults omitted flags to on.
+ wire := httptest.NewRecorder()
+ h.HandleGetNodes(wire, httptest.NewRequest(http.MethodGet, "/api/config/nodes", nil))
+ var payload []map[string]json.RawMessage
+ if wire.Code != http.StatusOK || json.Unmarshal(wire.Body.Bytes(), &payload) != nil || len(payload) != 1 {
+ t.Fatalf("scope GET failed: %d %s", wire.Code, wire.Body.String())
+ }
+ for key, expected := range map[string]bool{"monitorMailStats": tc.wantMail, "monitorQueues": tc.queues, "monitorQuarantine": false, "monitorDomainStats": false} {
+ raw, exists := payload[0][key]
+ var got bool
+ if !exists || json.Unmarshal(raw, &got) != nil || got != expected {
+ t.Fatalf("scope GET omitted/changed %s: %s", key, wire.Body.String())
+ }
+ }
+
saved, err := config.NewConfigPersistence(cfg.DataPath).LoadNodesConfig()
if err != nil {
t.Fatal(err)
diff --git a/internal/api/contract_test.go b/internal/api/contract_test.go
index a17fec2df6..254e02e202 100644
--- a/internal/api/contract_test.go
+++ b/internal/api/contract_test.go
@@ -27055,3 +27055,21 @@ func TestContract_PMGUncollectedDatasetsRemainAbsent(t *testing.T) {
t.Fatalf("missing dataset became zero/healthy data: %+v", got)
}
}
+
+func TestContract_PMGFalseScopeIsExplicitOnWire(t *testing.T) {
+ node := configapi.NodeResponse{ID: "pmg-0", Type: "pmg", Name: "gateway"}
+ raw, err := json.Marshal(node)
+ if err != nil {
+ t.Fatal(err)
+ }
+ var payload map[string]json.RawMessage
+ if err := json.Unmarshal(raw, &payload); err != nil {
+ t.Fatal(err)
+ }
+ for _, key := range []string{"monitorMailStats", "monitorQueues", "monitorQuarantine", "monitorDomainStats"} {
+ value, exists := payload[key]
+ if !exists || string(value) != "false" {
+ t.Fatalf("saved opt-out omitted/changed %s: %s", key, raw)
+ }
+ }
+}