Skip to content

Add vrfRef to BGP and propagate VRF through BGPPeer controller#302

Open
felix-kaestner wants to merge 1 commit intomainfrom
vrfref
Open

Add vrfRef to BGP and propagate VRF through BGPPeer controller#302
felix-kaestner wants to merge 1 commit intomainfrom
vrfref

Conversation

@felix-kaestner
Copy link
Copy Markdown
Contributor

BGP.Spec gains an optional VrfRef field that scopes the BGP instance to a VRF. Both the BGP and BGPPeer controllers resolve this reference and pass the VRF to all provider calls.

The BGPPeer controller gains a reconcileVRF helper that resolves BGP.Spec.VrfRef and sets ConfiguredCondition on failure; it returns nil when unset so the provider uses the default VRF.

A vrfToBGPPeers mapper and VRF watcher (create/delete only) enqueue affected peers when their BGP's VRF definition changes. The BGP watcher predicate is extended to trigger on any ready state change and when VrfRef changes.

@felix-kaestner felix-kaestner requested a review from a team as a code owner April 15, 2026 13:44
@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label Apr 16, 2026
@hardikdr hardikdr added this to Roadmap Apr 16, 2026
@felix-kaestner felix-kaestner force-pushed the bgpref branch 4 times, most recently from e39bf7c to 7f07bd4 Compare April 16, 2026 16:35
Base automatically changed from bgpref to main April 16, 2026 16:44
@felix-kaestner felix-kaestner force-pushed the vrfref branch 2 times, most recently from 3dc65b0 to 9469b2a Compare April 16, 2026 17:04
BGP.Spec gains an optional VrfRef field that scopes the BGP instance
to a VRF. Both the BGP and BGPPeer controllers resolve this reference
and pass the VRF to all provider calls.

The BGPPeer controller gains a reconcileVRF helper that resolves
BGP.Spec.VrfRef and sets ConfiguredCondition on failure; it returns
nil when unset so the provider uses the default VRF.

A vrfToBGPPeers mapper and VRF watcher (create/delete only) enqueue
affected peers when their BGP's VRF definition changes. The BGP watcher
predicate is extended to trigger on any ready state change and when
VrfRef changes.
@github-actions
Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 1 increase)

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1 0.00% (ø)
github.com/ironcore-dev/network-operator/internal/controller/core 63.69% (+0.05%) 👍
github.com/ironcore-dev/network-operator/internal/provider 52.00% (ø)
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos 10.13% (-0.05%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/bgp_types.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/api/core/v1alpha1/zz_generated.deepcopy.go 0.00% (ø) 0 0 0
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_controller.go 68.21% (+7.78%) 173 (+34) 118 (+34) 55 👍
github.com/ironcore-dev/network-operator/internal/controller/core/bgp_peer_controller.go 64.57% (-4.45%) 254 (+41) 164 (+17) 90 (+24) 👎
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/bgp.go 20.75% (ø) 53 11 42
github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/provider.go 0.06% (-0.00%) 1650 (+11) 1 1649 (+11) 👎
github.com/ironcore-dev/network-operator/internal/provider/provider.go 52.00% (ø) 25 13 12

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/controller/core/bgp_controller_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go
  • github.com/ironcore-dev/network-operator/internal/provider/cisco/nxos/bgp_test.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/L

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants