-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unpublish VPC router related endpoints #4493
Conversation
Wait!!! Don't you need to be able to delete these in order to delete Subnets, so you can delete VPCs, so you can delete projects? |
Great point. I forgot to check. I was surprised to find everything is fine. VPC routers are children of VPCs, not subnets. omicron/schema/crdb/dbinit.sql Lines 1400 to 1412 in 6bbaa80
The child of subnet is a NIC, so delete subnet checks for child NICs but not child routers. omicron/nexus/db-queries/src/db/datastore/vpc.rs Lines 761 to 818 in 6bbaa80
I think the relationship between subnets and routers and you might have had in mind is this: creating a subnet causes a route to be created in the system router, and deleting a subnet causes that route to be deleted. At least, that's supposed to be what happens — it turns out that is an undone TODO: omicron/nexus/src/app/vpc_subnet.rs Lines 66 to 68 in 6bbaa80
omicron/nexus/src/app/vpc_subnet.rs Lines 242 to 244 in 6bbaa80
VPC delete checks for child subnets but not child routers: omicron/nexus/db-queries/src/db/datastore/vpc.rs Lines 434 to 504 in 6bbaa80
Delete router itself doesn't have any conditions. omicron/nexus/db-queries/src/db/datastore/vpc.rs Lines 939 to 961 in 6bbaa80
Finally, the delete VPC function in nexus/app also deletes all routers. Lines 130 to 165 in 6bbaa80
I tested this on dogfood and was able to delete a VPC after deleting subnets, did not have to delete routers. The VPCs integration test also covers this when it deletes a VPC after deleting subnets. omicron/nexus/tests/integration_tests/vpcs.rs Lines 189 to 200 in 6bbaa80
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point. I forgot to check. I was surprised to find everything is fine.
phew 😅 carry on then
An additional note on the API surface is that every VPC has a System VPC Router, which always exists with the VPC. The bits that weren't there yet while show information about that router also allow for custom VPC Routers to be created which are then applied to individual subnets. So in the future, when there are custom VPC routers that can apply to subnets, that'll likely be something we consider blocking a VPC delete, but since none of those exist today and the System VPC router is not something that can be created or destroyed (from a theoretical perspective, obviously this doesn't exist hence the unpublish). |
These endpoints aren't currently used for anything, so we don't want them showing up in either the docs, the generated clients, or the CLI.
Per https://github.com/oxidecomputer/docs/issues/232 (private repo)