R-492: delete the always-empty cfg.Paths.HDDPath (field, env binding, every fallback)
Readers (report builder, health check, /api/system, web primaryHDDPath, metrics collector, AutoDiscoverStoragePaths' fallback parameter) now use the storage registry only. An old controller.yaml still carrying paths.hdd_path keeps loading (non-strict YAML), pinned by TestR492_OldConfigWithHDDPathStillLoads. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
@@ -30,7 +30,6 @@ func TestAutoDiscoverStoragePaths_Additive(t *testing.T) {
|
||||
name string
|
||||
existing []StoragePath
|
||||
discovered []string
|
||||
fallback string
|
||||
wantPaths []string // expected Path set after discovery (order-insensitive)
|
||||
wantNewPath string // a path expected to be newly added (may be "")
|
||||
// assertions run against the resulting registry
|
||||
@@ -101,17 +100,6 @@ func TestAutoDiscoverStoragePaths_Additive(t *testing.T) {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "fallback path registered when missing",
|
||||
existing: []StoragePath{
|
||||
{Path: "/mnt/felhom-usb", Label: "x", IsDefault: true, Schedulable: true, AddedAt: "2026-01-01T00:00:00Z"},
|
||||
},
|
||||
discovered: nil,
|
||||
fallback: "/mnt/legacy_hdd",
|
||||
wantPaths: []string{"/mnt/felhom-usb", "/mnt/legacy_hdd"},
|
||||
wantNewPath: "/mnt/legacy_hdd",
|
||||
check: nil,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
@@ -119,7 +107,7 @@ func TestAutoDiscoverStoragePaths_Additive(t *testing.T) {
|
||||
s := newTestSettings(t, cloneStoragePaths(tc.existing))
|
||||
before := cloneStoragePaths(tc.existing)
|
||||
|
||||
s.AutoDiscoverStoragePaths(tc.discovered, tc.fallback, logger)
|
||||
s.AutoDiscoverStoragePaths(tc.discovered, logger)
|
||||
|
||||
// Normalize with filepath.Clean so comparisons hold on both Linux (the deploy
|
||||
// target) and Windows (the dev machine), where Clean uses backslashes.
|
||||
@@ -158,7 +146,7 @@ func TestAutoDiscoverStoragePaths_DecommissionedNotReactivated(t *testing.T) {
|
||||
before := cloneStoragePaths(existing)
|
||||
|
||||
// A deployed app still points at the decommissioned drive.
|
||||
s.AutoDiscoverStoragePaths([]string{"/mnt/old_hdd", "/mnt/felhom-usb"}, "", logger)
|
||||
s.AutoDiscoverStoragePaths([]string{"/mnt/old_hdd", "/mnt/felhom-usb"}, logger)
|
||||
|
||||
if len(s.StoragePaths) != 2 {
|
||||
t.Fatalf("path count changed: got %d want 2 (%v)", len(s.StoragePaths), pathList(s))
|
||||
|
||||
Reference in New Issue
Block a user