Add AsnClaim and Asn - #606
Open
jstudler wants to merge 1 commit into
Open
Conversation
jstudler
force-pushed
the
feature/add-asn
branch
2 times, most recently
from
July 31, 2026 09:38
4bce36d to
4c476e7
Compare
jstudler
force-pushed
the
feature/add-asn
branch
from
July 31, 2026 10:02
4c476e7 to
8fecefb
Compare
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.
Add ASN and AsnClaim support
Adds ASN (Autonomous System Number) management to the NetBox Operator, following the same claim/resource pattern already used for IP addresses, prefixes and IP ranges.
New CRDs
Asn— represents a single ASN in NetBox.AsnClaim— claims an available ASN from a NetBox ASN Range viaparentAsnRange(matched by range name) and creates an ownedAsnCR. Status exposes the assignedasnandasnName.Controllers
AsnReconciler— reserves/updates the ASN in NetBox, finalizer-based cleanup (asn.netbox.dev/finalizer), lease-locks the parent ASN range while the ASN is not yet Ready, tracks managed custom fields via annotation, reports conditions and events.AsnClaimReconciler— allocates an ASN from the parent range, restores a previously assigned ASN by hash before falling back to a new allocation, syncs mutable fields down to the ownedAsn, lease-locks per range to avoid races between concurrent claims.NetBox client
New methods on
NetboxCompositeClient:ReserveOrUpdateAsn,DeleteAsn,RestoreExistingAsnByHash,GetAvailableAsnByClaim, plus internal RIR resolution and ASN-range-by-name lookup. NewASN/ASNClaimmodels and regenerated mocks for theIpamAsns*/IpamAsnRanges*API surface.Tests & docs
tests/e2e/asn: apply/update, restore, range-exhausted and owner-reference cases; local test data (RIR + ASN ranges) seeded in the kind data-load job.Asn/AsnClaimmodel,parentAsnRangesemantics and restoration.Behaviour notes
Asndeletes the CR.preserveInNetbox: truekeeps the ASN in NetBox after CR deletion, enabling later reclaim.asnandtenantimmutability is enforced by CEL validation rules.Open Questions