feat: search multiple NetBox instances with isolated host identities
Release / release (push) Successful in 5m16s
Release / release (push) Successful in 5m16s
This commit is contained in:
1 parent
a2a6dd7591
commit
7f53b90266
26 files changed
+1299
-115
No files matched your search
Vendored
+2
-1
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user