Skip to content

fix(inventory): drop derived short names shared by several hosts - #35

Merged
ntwrknrd merged 1 commit into
mainfrom
fix/ambiguous-short-names
Oct 28, 2026
Merged

ntwrknrd merged 1 commit into
mainfrom
fix/ambiguous-short-names

Conversation

@ntwrknrd

Copy link
Copy Markdown
Owner

Summary

Devices such as rtr1.whiteford.richmond.expedient.com and rtr1.whiteford.roanokeva.expedient.com both derive the short name rtr1. Lookup silently chose the lexically first host, so nssh rtr1 could reach the wrong router, and nssh inv status local reported a duplicate.

A derived short name that more than one host would claim now identifies none of them:

  • internal/inventory/engine.go: Reconcile drops shared derived patterns from provider state.
  • internal/connect/catalog.go: equal-rank derived short names become ambiguous and unresolvable. Full names and explicit aliases keep their precedence and lexical tie-break.

Verification

  • New reconcile test; updated catalog test.
  • make container-test passes.
  • Branch build against a copy of production config and state: after refresh, rtr1 is not found, both FQDNs resolve, acm-core1 and 151-core1 still resolve by short name, and the local duplicate finding is gone.

Two NetBox routers named rtr1.<site>.example.com both derived the short name
rtr1, and lookup silently picked the lexically first. A derived short name
claimed by more than one host now identifies none of them, both in provider
state and in the lookup catalog. Full names and explicit aliases keep their
existing precedence.
@ntwrknrd
ntwrknrd merged commit 67433ec into main Oct 28, 2026
3 checks passed
@ntwrknrd
ntwrknrd deleted the fix/ambiguous-short-names branch October 28, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant