Instance network interfaces don't need to be paginated (#1009)#1164
Instance network interfaces don't need to be paginated (#1009)#1164ryaeng wants to merge 7 commits into
Conversation
…#1009) Removed page params from entrypoint, app, and db calls.
| dsl::network_interface | ||
| .filter(dsl::time_deleted.is_null()) | ||
| .filter(dsl::instance_id.eq(authz_instance.id())) | ||
| .filter(dsl::vpc_id.eq(authz_instance.id())) |
There was a problem hiding this comment.
It seems you're checking if the vpc_id equals the instance ID — that can't be right.
There was a problem hiding this comment.
@david-crespo What's a good way to test this?
There was a problem hiding this comment.
I believe this would be caught by the existing integration tests. Specifically, this call here fetches the existing NICs attached to an instance. I can't see how that would return anything if the wrong UUID were used.
Can you show the output of your tests against this commit?
There was a problem hiding this comment.
If you look at CI on this commit, the tests passed even when that bug was in place
|
Thank you for your contribution. I have been meaning to make a similar change at some point. |
|
I'll have these fixed momentarily. What's the best way to amend this PR with the changes? |
|
@ryaeng Pushing a new commit is fine. It'll all be squashed at merge time. |
Awesome! Thanks. |
|
Done |
|
This is looking pretty good. The reason I haven't merged is I'm mulling over whether the endpoint should still return omicron/nexus/src/external_api/http_entrypoints.rs Lines 2458 to 2461 in 215491b we return a dedicated struct that just has the rules on it: omicron/common/src/api/external/mod.rs Lines 1409 to 1413 in 215491b That is probably what we should do here too, though I would prefer it live in |
|
|
|
I'll make this happen tomorrow, fellas. |
- Modify instance_network_interfaces_get to return NetworkInterfaces
|
Got this done. Spent a couple of hours working on it before I realized I was comparing it to subnets and not firewall rules 🤦♂️. What is the rule for creating tests? Trying to determine whether this change needs a test or not. Seems rather trivial so I didn't include one but I can fix that if necessary. |
|
Seems there's a conflict. Lemme pull that in real quick and then I'll perform another push. |
…instance-network-interfaces
|
Ok, this is good! Thank you! Re: tests, I would have said no additional test is required beyond what we already have for basic functionality, but the vpc_id == instance_id mistake was not caught by any existing test. So if you want to add one that would have caught that, that would be great. |
Add test to list interfaces attached to an instance
- Create test for instance_network_interfaces_get - Replace object_get with helper function across tests - Fix typos
|
@david-crespo Came back around to this one. Should be up to par. Thanks. |
Crucible changes: Per client, queue-based backpressure (#1186) A builder for the Downstairs Downstairs struct. (#1152) Update Rust to v1.76.0 (#1153) Deactivate the read only parent after a scrub (#1180) Start byte-based backpressure earlier (#1179) Tweak CI scripts to fix warnings (#1178) Make `gw_ds_complete` less public (#1175) Verify extent under repair is valid after copying files (#1159) Remove individual panic setup, use global panic settings (#1174) [smf] Use new zone network config service (#1096) Move a few methods into downstairs (#1160) Remove extra clone in upstairs read (#1163) Make `crucible-downstairs` not depend on upstairs (#1165) Update Rust crate rusqlite to 0.31 (#1171) Update Rust crate reedline to 0.29.0 (#1170) Update Rust crate clap to 4.5 (#1169) Update Rust crate indicatif to 0.17.8 (#1168) Update progenitor to bc0bb4b (#1164) Do not 500 on snapshot delete for deleted region (#1162) Drop jobs from Offline downstairs. (#1157) `Mutex<Work>` → `Work` (#1156) Added a contributing.md (#1158) Remove ExtentFlushClose::source_downstairs (#1154) Remove unnecessary mutexes from Downstairs (#1132) Propolis changes: PHD: improve Windows reliability (#651) Update progenitor and omicron deps Clean up VMM resource on server shutdown Remove Inventory mechanism Update vergen dependency Properly handle pre/post illumos#16183 fixups PHD: add `pfexec` to xtask phd-runner invocation (#647) PHD: add Windows Server 2016 adapter & improve WS2016/2019 reliability (#646) PHD: use `clap` for more `cargo xtask phd` args (#645) PHD: several `cargo xtask phd` CLI fixes (#642) PHD: Use ZFS clones for file-backed disks (#640) PHD: improve ctrl-c handling (#634)
Crucible changes: Per client, queue-based backpressure (#1186) A builder for the Downstairs Downstairs struct. (#1152) Update Rust to v1.76.0 (#1153) Deactivate the read only parent after a scrub (#1180) Start byte-based backpressure earlier (#1179) Tweak CI scripts to fix warnings (#1178) Make `gw_ds_complete` less public (#1175) Verify extent under repair is valid after copying files (#1159) Remove individual panic setup, use global panic settings (#1174) [smf] Use new zone network config service (#1096) Move a few methods into downstairs (#1160) Remove extra clone in upstairs read (#1163) Make `crucible-downstairs` not depend on upstairs (#1165) Update Rust crate rusqlite to 0.31 (#1171) Update Rust crate reedline to 0.29.0 (#1170) Update Rust crate clap to 4.5 (#1169) Update Rust crate indicatif to 0.17.8 (#1168) Update progenitor to bc0bb4b (#1164) Do not 500 on snapshot delete for deleted region (#1162) Drop jobs from Offline downstairs. (#1157) `Mutex<Work>` → `Work` (#1156) Added a contributing.md (#1158) Remove ExtentFlushClose::source_downstairs (#1154) Remove unnecessary mutexes from Downstairs (#1132) Propolis changes: PHD: improve Windows reliability (#651) Update progenitor and omicron deps Clean up VMM resource on server shutdown Remove Inventory mechanism Update vergen dependency Properly handle pre/post illumos#16183 fixups PHD: add `pfexec` to xtask phd-runner invocation (#647) PHD: add Windows Server 2016 adapter & improve WS2016/2019 reliability (#646) PHD: use `clap` for more `cargo xtask phd` args (#645) PHD: several `cargo xtask phd` CLI fixes (#642) PHD: Use ZFS clones for file-backed disks (#640) PHD: improve ctrl-c handling (#634) Co-authored-by: Alan Hanson <alan@oxide.computer>
Removed page params from entrypoint, app, and db calls.