Skip to content

Commit

Permalink
restrict IP pool range add to v4 ranges. everything compiles??????
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Feb 17, 2024
1 parent 47a416f commit ea9611d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions end-to-end-tests/src/bin/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use end_to_end_tests::helpers::{generate_name, get_system_ip_pool};
use omicron_test_utils::dev::poll::{wait_for_condition, CondCheckError};
use oxide_client::types::{
ByteCount, DeviceAccessTokenRequest, DeviceAuthRequest, DeviceAuthVerify,
DiskCreate, DiskSource, IpPoolCreate, IpPoolLinkSilo, IpRange, Ipv4Range,
NameOrId, SiloQuotasUpdate,
DiskCreate, DiskSource, IpPoolCreate, IpPoolLinkSilo, Ipv4Range, NameOrId,
SiloQuotasUpdate,
};
use oxide_client::{
ClientDisksExt, ClientHiddenExt, ClientProjectsExt,
Expand Down Expand Up @@ -60,7 +60,7 @@ async fn main() -> Result<()> {
client
.ip_pool_range_add()
.pool(pool_name)
.body(IpRange::V4(Ipv4Range { first, last }))
.body(Ipv4Range { first, last })
.send()
.await?;

Expand Down
4 changes: 2 additions & 2 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1737,14 +1737,14 @@ async fn ip_pool_range_list(
async fn ip_pool_range_add(
rqctx: RequestContext<Arc<ServerContext>>,
path_params: Path<params::IpPoolPath>,
range_params: TypedBody<shared::IpRange>,
range_params: TypedBody<shared::Ipv4Range>,
) -> Result<HttpResponseCreated<IpPoolRange>, HttpError> {
let apictx = &rqctx.context();
let handler = async {
let opctx = crate::context::op_context_for_external_api(&rqctx).await?;
let nexus = &apictx.nexus;
let path = path_params.into_inner();
let range = range_params.into_inner();
let range = shared::IpRange::V4(range_params.into_inner());
let pool_lookup = nexus.ip_pool_lookup(&opctx, &path.pool)?;
let out = nexus.ip_pool_add_range(&opctx, &pool_lookup, &range).await?;
Ok(HttpResponseCreated(out.into()))
Expand Down
2 changes: 1 addition & 1 deletion openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -5194,7 +5194,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IpRange"
"$ref": "#/components/schemas/Ipv4Range"
}
}
},
Expand Down

0 comments on commit ea9611d

Please sign in to comment.