Commit 3c58a05
fix(vpcpeering): Do not insert peering with duplicate name
When we try to insert a peering with a name that already exists for
another peering in a VpcPeeringTable, this results in an error, but it
also results in the peering being inserted anyway, as we only detect the
name collision when inserting (and we do not implement rollback).
As a consequence, we keep an incorrect peering entry in the table. This
can cause unexpected collisions on prefixes when trying to add
subsequent, legitimate peerings to the table, for example.
Instead of inserting unconditionally, let's check first for the
existence of the peering name in the table.
Fixes: e45c0ef (feat(mgmt): define external model)
Signed-off-by: Quentin Monnet <[email protected]>1 parent 6648e73 commit 3c58a05
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
316 | 321 | | |
317 | 322 | | |
318 | 323 | | |
| |||
772 | 777 | | |
773 | 778 | | |
774 | 779 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | 780 | | |
780 | 781 | | |
781 | 782 | | |
782 | 783 | | |
783 | 784 | | |
784 | 785 | | |
785 | 786 | | |
786 | | - | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
0 commit comments