Add support for VlanGroup - #619
Open
flynn-nrg wants to merge 25 commits into
Open
Conversation
* Return body in the error * Resolves the site name to its NetBox slog before filtering. * For an explicit vid claim we make vidRangeStart = vidRangeEnd = vid and check if it already exists before assigning.
* Return body in the error * Resolves the site name to its NetBox slog before filtering. * For an explicit vid claim we make vidRangeStart = vidRangeEnd = vid and check if it already exists before assigning.
* use metadata.Name * Add workaround for json payload mistmatch.
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 VlanGroup support
Adds VLAN Group management to the NetBox Operator, stacked on top of the
Vlan/VlanClaimsupport. A VLAN Group is a named container for organizing VLANs, optionally scoped to a Site and constrained to a VID range.New CRD
VlanGroup— represents a single VLAN Group in NetBox (name, site, tenant, vidRangeStart/vidRangeEnd, description, custom fields, preserveInNetbox).Only
tenantandsitereferences are supported (both reuse the existing lookup helpers already used byVlan/VlanClaim). NetBox also supports Region/SiteGroup/Location/ClusterGroup/Cluster scopes, but none of those have lookup helpers in this codebase yet, so they're left out to keep this PR scoped.Controller
VlanGroupReconciler— reserves/updates the VLAN Group in NetBox (ReserveOrUpdateVlanGroup), finalizer-based cleanup (vlangroup.netbox.dev/finalizer), reports conditions and events.NetBox client
New methods on
NetboxCompositeClient:ReserveOrUpdateVlanGroup,DeleteVlanGroup, added directly to the existingIpamAPIinterface/adapter.Tests & docs
pkg/netbox/api/vlan_group_test.go) and for the controller (internal/controller/vlangroup_controller_test.go), covering reservation, update, reserve failure, and delete/404/non-404 cases.tests/e2e/vlangroup: create/update (including mutating site, tenant, description, and VID range on an existing group), invalid tenant, and invalid custom field cases.config/samples/.VlanGroupadded under the existing "VLAN Management" section.Behaviour notes
nameimmutability enforced via CEL validation;vidRangeStart/vidRangeEndmust be set together or not at all (also CEL-enforced).This was done with the help of Claude.