R-106 follow-up: mergeConfig dropped the pbs namespace, so v0.118.0's fix was inert (v0.118.1)

Live validation caught what the tests could not. On demo-felhom the recipe read
namespace "root" with namespace_state "resolved" — confident and wrong, a worse
shape than the original defect.

mergeConfig overlays the cluster storage config onto the node entry through a
hand-listed set of fields and Namespace was not among them. NodeStorage does not
return the namespace at all, so PBSNamespace always read "" and latestPBSCoord
correctly treated that as the root namespace.

Every v0.118.0 test built StorageTarget values directly — including the two
through Collector.Collect(), which inject a fakeObserver — so nothing crossed the
merge. Two new tests drive the real Observe path with PVE's actual split returns
and table the merge itself. Red-proof: dropping the added line fails both.

Suite rc=0, 29 packages, 0 FAIL.
This commit is contained in:
2026-07-30 13:23:21 +02:00
parent 1c8a67eece
commit 6b5dade4dc
3 changed files with 104 additions and 0 deletions
+11
View File
@@ -488,5 +488,16 @@ func mergeConfig(node, cluster proxmox.Storage) proxmox.Storage {
if node.Content == "" {
node.Content = cluster.Content
}
// R-106: the pbs namespace. `NodeStorage` does not return it AT ALL — it is cluster-config only —
// so without this line `Namespace` is always empty on the merged entry and every consumer sees a
// root-namespace box. Found by LIVE VALIDATION, not by the unit tests: the DR-recipe tests supply
// StorageTarget values directly, so they never crossed this merge.
//
// This function is a copy-only-what-is-needed allow-list, which is exactly how the gap arose. If you
// add a consumer of any other type-specific field (`Username` is the remaining unmerged one), add it
// here too and pin it in TestMergeConfig_CarriesPBSNamespace's table.
if node.Namespace == "" {
node.Namespace = cluster.Namespace
}
return node
}