Skip to content

feat(api): add backward-compatible LocalASNumber field to BGPPeer#421

Merged
nikatza merged 1 commit into
mainfrom
fix-bgppeer-api-change
Jun 24, 2026
Merged

feat(api): add backward-compatible LocalASNumber field to BGPPeer#421
nikatza merged 1 commit into
mainfrom
fix-bgppeer-api-change

Conversation

@nikatza

@nikatza nikatza commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Re-add the deprecated LocalASNumber field to BGPPeerSpec for backward compatibility with existing deployments. This field was removed in commit 05973e0 in favor of the new LocalAS struct.

Migration strategy:

  • LocalASNumber is marked as deprecated in godoc
  • CEL validation prevents using both fields simultaneously
  • Webhook returns deprecation warning when LocalASNumber is used
  • Controller converts LocalASNumber to LocalAS with default prepend flags

LocalASNumber will be removed in a future release once all deployments have migrated.

@nikatza nikatza force-pushed the fix-bgppeer-api-change branch 2 times, most recently from 9b7abe1 to 483b6f0 Compare June 24, 2026 13:43
@github-actions github-actions Bot added size/L and removed size/M labels Jun 24, 2026
@nikatza nikatza force-pushed the fix-bgppeer-api-change branch from 483b6f0 to 535478d Compare June 24, 2026 13:50
@nikatza nikatza marked this pull request as ready for review June 24, 2026 13:51
@nikatza nikatza requested a review from a team as a code owner June 24, 2026 13:51
@nikatza nikatza force-pushed the fix-bgppeer-api-change branch 3 times, most recently from d1642f9 to 74323b0 Compare June 24, 2026 14:09
@nikatza nikatza marked this pull request as draft June 24, 2026 14:21
@nikatza nikatza force-pushed the fix-bgppeer-api-change branch 2 times, most recently from c5ac98e to e566162 Compare June 24, 2026 14:37
@nikatza nikatza marked this pull request as ready for review June 24, 2026 14:47
Comment thread internal/controller/core/bgp_peer_controller.go Outdated
Comment thread internal/webhook/core/v1alpha1/bgppeer_webhook.go Outdated
@nikatza nikatza force-pushed the fix-bgppeer-api-change branch 2 times, most recently from 9f000f3 to 6fb8018 Compare June 24, 2026 15:32
Re-add the deprecated LocalASNumber field to BGPPeerSpec for backward
compatibility with existing deployments. This field was removed in
commit 05973e0 in favor of the new LocalAS struct.

Migration strategy:
- LocalASNumber is marked as deprecated in godoc
- CEL validation prevents using both fields simultaneously
- Webhook returns deprecation warning when LocalASNumber is used
- Controller converts LocalASNumber to LocalAS with default prepend
  flags

LocalASNumber will be removed in a future release once all deployments
have migrated.

Signed-off-by: Pujol <enric.pujol@sap.com>
@nikatza nikatza force-pushed the fix-bgppeer-api-change branch from 6fb8018 to fe31398 Compare June 24, 2026 15:41
@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.58% (-0.03%) 👎
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1 95.63% (+0.20%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/bgp_peer_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_peer_controller.go 58.02% (-0.05%) 324 (+2) 188 (+1) 136 (+1) 👎
github.com/ironcore-dev/network-operator/internal/webhook/core/v1alpha1/bgppeer_webhook.go 85.71% (+10.71%) 21 (+9) 18 (+9) 3 🎉

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/webhook/core/v1alpha1/bgppeer_webhook_test.go

@nikatza nikatza merged commit bf33b3d into main Jun 24, 2026
20 checks passed
@nikatza nikatza deleted the fix-bgppeer-api-change branch June 24, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants