feat: search multiple NetBox instances with isolated host identities
Release / release (push) Successful in 5m16s

This commit is contained in:
Sebastian Unterschütz committed 2026-10-27 23:14:42 +01:00
1 parent a2a6dd7591
commit 7f53b90266
26 files changed
+1299 -115

No files matched your search

+2 -1
View File
@@ -258,7 +258,8 @@ func (c *Cache) Search(prefix string) []Entry {
prefix = strings.ToLower(prefix)
var out []Entry
for name, e := range c.entries {
if strings.HasPrefix(strings.ToLower(name), prefix) {
_, hostname, qualified := strings.Cut(strings.ToLower(name), "/")
if strings.HasPrefix(strings.ToLower(name), prefix) || (qualified && !strings.Contains(prefix, "/") && strings.HasPrefix(hostname, prefix)) {
out = append(out, e)
}
}