Skip to content

Wire up public API for managing subnet pools#9744

Merged
bnaecker merged 2 commits intomainfrom
wire-up-subnet-pool-crud-api
Jan 30, 2026
Merged

Wire up public API for managing subnet pools#9744
bnaecker merged 2 commits intomainfrom
wire-up-subnet-pool-crud-api

Conversation

@bnaecker
Copy link
Collaborator

@bnaecker bnaecker commented Jan 29, 2026

- Wires up the subnet pool and subnet pool member CRUD to the database
  operations. Partial fix for #9453.
- Adds integration tests for these plus some resource helpers.
- New API version to remove pool type from the subnet pools and the
  name. Fixes #9740.
@bnaecker bnaecker force-pushed the wire-up-subnet-pool-crud-api branch from b083f99 to 69c4356 Compare January 29, 2026 15:45
@bnaecker bnaecker requested a review from david-crespo January 29, 2026 15:45
- Typos and comments around API changes, more descriptive version name
- Remove unneeded conversions
- Add test for adding members of a mismatched version to a subnet pool
- Fix overlap in demo IP / Subnet pool ranges
@bnaecker bnaecker enabled auto-merge (squash) January 29, 2026 18:37
@david-crespo
Copy link
Contributor

david-crespo commented Jan 29, 2026

Still planning on doing this part? Looks like kind of a lot of stuff on the member struct.

Subnet pool members, the individual subnets in them, currently have all the identity metadata that most API resources have, like a name, description, etc. I think we want these to be more like IP Pool Ranges, where the only identifying information is a UUID and the CIDR block itself. You can't update these, and names don't really do anything for you, since the IP subnet is the identity of the thing.

@bnaecker
Copy link
Collaborator Author

Well that's fun. Looks like we hit a 2h timeout, presumably in Buildomat, and the whole job was killed. I'm rerunning it.

@bnaecker bnaecker disabled auto-merge January 29, 2026 22:13
@bnaecker
Copy link
Collaborator Author

Still planning on doing this part? Looks like kind of a lot of stuff on the member struct.

Subnet pool members, the individual subnets in them, currently have all the identity metadata that most API resources have, like a name, description, etc. I think we want these to be more like IP Pool Ranges, where the only identifying information is a UUID and the CIDR block itself. You can't update these, and names don't really do anything for you, since the IP subnet is the identity of the thing.

Did I not do that? I'm very confused.

The latest commit in my branch is:

bnaecker@shale : ~/omicron $ git log --oneline -2
1822c4c32 (HEAD -> wire-up-subnet-pool-crud-api, origin/wire-up-subnet-pool-crud-api) Review feedback
69c435641 Wire up public API for managing subnet pools

If you click on "Commits" above, you get to this list, which has those exact hashes. Browsing the repo at that point and getting to the right file shows:

pub struct SubnetPoolMember {
/// ID of the pool member
pub id: Uuid,
/// Time the pool member was created.
pub time_created: DateTime<Utc>,
/// ID of the parent subnet pool
pub subnet_pool_id: Uuid,
/// The subnet CIDR
pub subnet: IpNet,
/// Minimum prefix length for allocations from this subnet; a smaller prefix
/// means larger allocations are allowed (e.g. a /16 prefix yields larger
/// subnet allocations than a /24 prefix).
pub min_prefix_length: u8,
/// Maximum prefix length for allocations from this subnet; a larger prefix
/// means smaller allocations are allowed (e.g. a /24 prefix yields smaller
/// subnet allocations than a /16 prefix).
pub max_prefix_length: u8,
}

Am I missing something?

@david-crespo
Copy link
Contributor

Sorry! I think I was looking at an out of date diff or maybe I just misread it. Got it, looks good. (output from my api-diff tool that diffs the TS client)

image

@bnaecker bnaecker enabled auto-merge (squash) January 29, 2026 22:24
rqctx: RequestContext<Self::Context>,
path_params: Path<params::SubnetPoolPath>,
query_params: Query<PaginatedByNameOrId>,
query_params: Query<SubnetPoolMemberPaginationParams>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This resulted in this change to the query params. Seems right since there is no longer any name to sort by.

Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we're sorting by IP subnet.

@rcgoodfellow rcgoodfellow linked an issue Jan 30, 2026 that may be closed by this pull request
10 tasks
@bnaecker bnaecker merged commit a0b8129 into main Jan 30, 2026
16 checks passed
@bnaecker bnaecker deleted the wire-up-subnet-pool-crud-api branch January 30, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor cleanup of subnet pool API Control plane support for attached subnets.

3 participants