feat(instances): allow disabling prefixes in aliases and TUI
This commit is contained in:
1 parent
1f46d9d9e5
commit
20d7a40543
12 files changed
+298
-19
No files matched your search
@@ -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")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user