-
Notifications
You must be signed in to change notification settings - Fork 128
feat(zero-dpu): Allow flat VPC's to not belong to a network segment #2666
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ use std::fmt::Write; | |
| use ::rpc::admin_cli::OutputFormat; | ||
| use ::rpc::forge as forgerpc; | ||
| use carbide_uuid::machine::MachineId; | ||
| use carbide_uuid::vpc::VpcId; | ||
| use prettytable::{Table, row}; | ||
| use rpc::Machine; | ||
|
|
||
|
|
@@ -428,7 +429,7 @@ pub async fn get_next_free_machine( | |
| api_client: &ApiClient, | ||
| machine_ids: &mut VecDeque<MachineId>, | ||
| min_interface_count: usize, | ||
| zero_dpu: bool, | ||
| flat_vpc_id: Option<VpcId>, | ||
| ) -> Option<Machine> { | ||
| while let Some(id) = machine_ids.pop_front() { | ||
| tracing::debug!("Checking {}", id); | ||
|
|
@@ -437,7 +438,7 @@ pub async fn get_next_free_machine( | |
| tracing::debug!("Machine is not ready"); | ||
| continue; | ||
| } | ||
| if zero_dpu { | ||
| if flat_vpc_id.is_some() { | ||
| return Some(machine); | ||
| } | ||
|
Comment on lines
+441
to
443
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filter flat-VPC allocation to static-membership machines. This returns the first Proposed fix- if flat_vpc_id.is_some() {
- return Some(machine);
- }
+ if flat_vpc_id.is_some() {
+ let supports_static_membership = machine
+ .instance_network_restrictions
+ .as_ref()
+ .is_some_and(|restrictions| {
+ restrictions.network_segment_membership_type
+ == forgerpc::InstanceNetworkSegmentMembershipType::Static as i32
+ });
+
+ if supports_static_membership {
+ return Some(machine);
+ }
+
+ tracing::debug!(%id, "machine does not support flat VPC auto allocation");
+ continue;
+ }🤖 Prompt for AI Agents |
||
| if let Some(discovery_info) = &machine.discovery_info { | ||
|
|
||
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.
Preserve interface-to-VPC alignment when lookups are missing.
filter_map(...).flatten()shrinks the lookup result list, so a missingvpc_id, missing segment ID, or not-found VPC shifts later VPCs onto the wrong interface rows. Collect oneOption<Vpc>per rendered interface.Proposed fix
🤖 Prompt for AI Agents