Skip to content

[bgp-config] fix create idempotency#10781

Merged
nicolaskagami merged 2 commits into
mainfrom
nsk/bgp-config-create-idempostency
Jul 15, 2026
Merged

[bgp-config] fix create idempotency#10781
nicolaskagami merged 2 commits into
mainfrom
nsk/bgp-config-create-idempostency

Conversation

@nicolaskagami

Copy link
Copy Markdown
Contributor
  • Adds missing check for description and max_paths fields for idempotency.
  • Uses destructuring to exhaustively match on fields so that new ones are less likely to be forgotten.
  • Adds a simple smoke test.

Fixes #10765

The BgpConfig create endpoint explicitly checks for idempotency and returns OK if all fields match an already existing entry. Regardless of whether we want to keep this behavior, this PR merely fixes the implementation for a few fields.

@nicolaskagami
nicolaskagami marked this pull request as ready for review July 9, 2026 15:54
@nicolaskagami
nicolaskagami requested review from david-crespo, internet-diglett and jgallagher and removed request for internet-diglett July 9, 2026 16:45
Comment thread nexus/db-queries/src/db/datastore/bgp.rs
@david-crespo

Copy link
Copy Markdown
Contributor

This looks good if we want to keep the idempotency behavior. I'm investigating (with a prototype I'll post as a draft PR) the alternative of making it work like all the other endpoints and just 409 on a name conflict.

@nicolaskagami

Copy link
Copy Markdown
Contributor Author

This looks good if we want to keep the idempotency behavior. I'm investigating (with a prototype I'll post as a draft PR) the alternative of making it work like all the other endpoints and just 409 on a name conflict.

I think it makes sense to fix the idempotency for now while we discuss removing it.

@nicolaskagami
nicolaskagami merged commit 91a0417 into main Jul 15, 2026
19 checks passed
@nicolaskagami
nicolaskagami deleted the nsk/bgp-config-create-idempostency branch July 15, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BgpConfig create endpoint responds 200 incorrectly

2 participants