feat(instances): allow disabling prefixes in aliases and TUI
Test / test (push) Successful in 3m19s
Release / release (push) Successful in 8m31s

This commit is contained in:
Sebastian Unterschütz committed 2026-11-16 22:13:05 +01:00
1 parent 1f46d9d9e5
commit 20d7a40543
12 files changed
+298 -19

No files matched your search

+8
View File
@@ -15,6 +15,7 @@ func TestLoadNamedNetBoxes(t *testing.T) {
- name: Office
url: https://office.example/netbox
token: nbt_office
disable_prefix: true
- name: lab
url: https://lab.example
token: legacy-token
@@ -34,7 +35,14 @@ cache:
if cfg.NetBox.URL != "" {
t.Fatal("legacy environment variables added an unnamed instance")
}
if !cfg.NetBoxes[0].DisablePrefix || cfg.NetBoxes[1].DisablePrefix {
t.Fatal("per-instance alias prefix setting was not loaded")
}
first := cfg.CachePath()
cfg.NetBoxes[0].DisablePrefix = false
if cfg.CachePath() != first {
t.Fatal("alias prefix setting discarded cache")
}
if first == cfg.Cache.Path {
t.Fatal("named sources reuse legacy cache")
}