Repository navigation
fix(inventory): drop derived short names shared by several hosts - #35
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Devices such as
rtr1.whiteford.richmond.expedient.comandrtr1.whiteford.roanokeva.expedient.comboth derive the short namertr1. Lookup silently chose the lexically first host, sonssh rtr1could reach the wrong router, andnssh inv status localreported a duplicate.A derived short name that more than one host would claim now identifies none of them:
internal/inventory/engine.go:Reconciledrops 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
make container-testpasses.rtr1is not found, both FQDNs resolve,acm-core1and151-core1still resolve by short name, and the local duplicate finding is gone.