Commit 6648e73
feat(vpcpeering): Extend validation when adding VpcPeering to a table
In a previous commit, we checked new VpcExpose for prefix overlap when
adding them to a VpcManifest. It turns out that once this VpcManifest
has been added to a VpcPeering, we also need to detect overlap between
the prefixes of the exposes from the manifests from the new peering and
the existing exposes from manifests from existing peerings in the
VpcPeeringTable object, when they relate to the same VPC.
To detect overlap, we reuse the dedicated function introduced in a
previous commit.
On the tests side:
- Add a dedicated unit test.
- Fix some tests that would incorrectly reuse VpcExpose objects for
multiple peerings about the same VPC.
- Comment out one unrelated unit test. This is because this commit
uncovers a bug. When we attempt to add a peering with a name that
already exists in the VpcPeeringTable, we get an error, but we still
insert the new peering into the table anyway (no rollback). As a
consequence, we have an undesired peering remaining in the table and
this may, for example, cause collisions if we later try to add another
legitimate peering that uses the same VpcExpose objects (as we do
later in the test). This bug will be fixed in a subsequent commit.
Signed-off-by: Quentin Monnet <qmo@qmon.net>1 parent 118afc8 commit 6648e73
2 files changed
Lines changed: 59 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
226 | 232 | | |
227 | 233 | | |
228 | 234 | | |
| |||
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
259 | | - | |
| 265 | + | |
260 | 266 | | |
261 | 267 | | |
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
267 | | - | |
| 273 | + | |
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
274 | 280 | | |
275 | | - | |
| 281 | + | |
276 | 282 | | |
277 | 283 | | |
278 | 284 | | |
279 | 285 | | |
280 | 286 | | |
281 | 287 | | |
282 | 288 | | |
283 | | - | |
| 289 | + | |
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
284 | 311 | | |
285 | 312 | | |
286 | 313 | | |
| 314 | + | |
| 315 | + | |
287 | 316 | | |
288 | 317 | | |
289 | 318 | | |
| |||
716 | 745 | | |
717 | 746 | | |
718 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
719 | 758 | | |
720 | 759 | | |
721 | 760 | | |
| |||
733 | 772 | | |
734 | 773 | | |
735 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
736 | 779 | | |
737 | 780 | | |
738 | 781 | | |
739 | 782 | | |
740 | 783 | | |
741 | 784 | | |
742 | 785 | | |
| 786 | + | |
743 | 787 | | |
744 | 788 | | |
745 | 789 | | |
| |||
0 commit comments