diff --git a/nexus/db-queries/src/db/datastore/volume.rs b/nexus/db-queries/src/db/datastore/volume.rs index 32fb6f6310..498c28d886 100644 --- a/nexus/db-queries/src/db/datastore/volume.rs +++ b/nexus/db-queries/src/db/datastore/volume.rs @@ -4216,9 +4216,9 @@ mod tests { id: volume_id, target: vec![ // target to replace - SocketAddr::V6(region_addresses[0].clone()), - SocketAddr::V6(region_addresses[1].clone()), - SocketAddr::V6(region_addresses[2].clone()), + SocketAddr::V6(region_addresses[0]), + SocketAddr::V6(region_addresses[1]), + SocketAddr::V6(region_addresses[2]), ], lossy: false, flush_timeout: None, @@ -4336,9 +4336,9 @@ mod tests { opts: CrucibleOpts { id: volume_id, target: vec![ - SocketAddr::V6(region_addresses[0].clone()), // back to what it was - SocketAddr::V6(region_addresses[1].clone()), - SocketAddr::V6(region_addresses[2].clone()), + SocketAddr::V6(region_addresses[0]), // back to what it was + SocketAddr::V6(region_addresses[1]), + SocketAddr::V6(region_addresses[2]), ], lossy: false, flush_timeout: None, diff --git a/nexus/src/app/sagas/snapshot_create.rs b/nexus/src/app/sagas/snapshot_create.rs index f338dfc78e..12a92b63ab 100644 --- a/nexus/src/app/sagas/snapshot_create.rs +++ b/nexus/src/app/sagas/snapshot_create.rs @@ -1454,7 +1454,7 @@ async fn ssc_start_running_snapshot( )); info!(log, "map {} to {}", region_addr, snapshot_addr); - map.insert(region_addr, snapshot_addr.clone()); + map.insert(region_addr, snapshot_addr); // Once snapshot has been validated, and running snapshot has been // started, add an entry in the region_snapshot table to correspond to diff --git a/nexus/tests/integration_tests/volume_management.rs b/nexus/tests/integration_tests/volume_management.rs index 31e1519194..f68c6a3ea7 100644 --- a/nexus/tests/integration_tests/volume_management.rs +++ b/nexus/tests/integration_tests/volume_management.rs @@ -2284,9 +2284,9 @@ async fn test_keep_your_targets_straight(cptestctx: &ControlPlaneTestContext) { opts: CrucibleOpts { id: Uuid::new_v4(), target: vec![ - region_snapshots[0].3.clone(), - region_snapshots[1].3.clone(), - region_snapshots[2].3.clone(), + region_snapshots[0].3, + region_snapshots[1].3, + region_snapshots[2].3, ], lossy: false, flush_timeout: None, @@ -2405,9 +2405,9 @@ async fn test_keep_your_targets_straight(cptestctx: &ControlPlaneTestContext) { opts: CrucibleOpts { id: Uuid::new_v4(), target: vec![ - region_snapshots[3].3.clone(), - region_snapshots[4].3.clone(), - region_snapshots[5].3.clone(), + region_snapshots[3].3, + region_snapshots[4].3, + region_snapshots[5].3, ], lossy: false, flush_timeout: None, @@ -3567,7 +3567,7 @@ struct TestReadOnlyRegionReferenceUsage { datastore: Arc, region: db::model::Region, - region_address: SocketAddrV6, + region_address: SocketAddr, first_volume_id: Uuid, second_volume_id: Uuid, @@ -3628,8 +3628,9 @@ impl TestReadOnlyRegionReferenceUsage { // so fill in a random port here. datastore.region_set_port(region.id(), 12345).await.unwrap(); - let region_address = - datastore.region_addr(region.id()).await.unwrap().unwrap(); + let region_address = SocketAddr::V6( + datastore.region_addr(region.id()).await.unwrap().unwrap(), + ); let region = datastore.get_region(region.id()).await.unwrap(); @@ -3660,7 +3661,7 @@ impl TestReadOnlyRegionReferenceUsage { gen: 1, opts: CrucibleOpts { id: Uuid::new_v4(), - target: vec![SocketAddr::V6(self.region_address)], + target: vec![self.region_address], lossy: false, flush_timeout: None, key: None, @@ -3790,9 +3791,7 @@ impl TestReadOnlyRegionReferenceUsage { gen: 1, opts: CrucibleOpts { id: Uuid::new_v4(), - target: vec![SocketAddr::V6( - self.region_address, - )], + target: vec![self.region_address], lossy: false, flush_timeout: None, key: None, @@ -3825,7 +3824,7 @@ impl TestReadOnlyRegionReferenceUsage { gen: 1, opts: CrucibleOpts { id: Uuid::new_v4(), - target: vec![SocketAddr::V6(self.region_address)], + target: vec![self.region_address], lossy: false, flush_timeout: None, key: None, @@ -3860,7 +3859,7 @@ impl TestReadOnlyRegionReferenceUsage { gen: 1, opts: CrucibleOpts { id: Uuid::new_v4(), - target: vec![SocketAddr::V6(self.region_address)], + target: vec![self.region_address], lossy: false, flush_timeout: None, key: None, @@ -5482,9 +5481,9 @@ async fn test_migrate_to_ref_count_with_records_region_snapshot_deleting( opts: CrucibleOpts { id: Uuid::new_v4(), target: vec![ - region_snapshots[1].3.clone(), - region_snapshots[2].3.clone(), - region_snapshots[3].3.clone(), + region_snapshots[1].3, + region_snapshots[2].3, + region_snapshots[3].3, ], lossy: false, flush_timeout: None, @@ -5522,8 +5521,10 @@ async fn test_migrate_to_ref_count_with_records_region_snapshot_deleting( ); assert_eq!(region_snapshot_to_delete.region_id, region_snapshots[0].1); assert_eq!(region_snapshot_to_delete.snapshot_id, region_snapshots[0].2); - assert_eq!(region_snapshot_to_delete.snapshot_addr.parse::().unwrap(), - region_snapshots[0].3); + assert_eq!( + region_snapshot_to_delete.snapshot_addr.parse::().unwrap(), + region_snapshots[0].3 + ); assert_eq!(region_snapshot_to_delete.volume_references, 0); assert_eq!(region_snapshot_to_delete.deleting, true); diff --git a/sled-agent/src/instance.rs b/sled-agent/src/instance.rs index b540ccf160..4dd8e46a33 100644 --- a/sled-agent/src/instance.rs +++ b/sled-agent/src/instance.rs @@ -1001,8 +1001,6 @@ impl InstanceRunner { format!("{id}:device") } - // The basic spec enables COM1-COM4 by default. Everything else - // needs to be added manually. let mut spec = propolis_client::types::InstanceSpecV0 { board: Board { chipset: Chipset::default(), diff --git a/sled-agent/src/sim/sled_agent.rs b/sled-agent/src/sim/sled_agent.rs index c3c326b802..0653b52508 100644 --- a/sled-agent/src/sim/sled_agent.rs +++ b/sled-agent/src/sim/sled_agent.rs @@ -44,11 +44,11 @@ use omicron_uuid_kinds::{ SupportBundleUuid, ZpoolUuid, }; use oxnet::Ipv6Net; -use propolis_client::types::{ - Board, Chipset, ComponentV0, SerialPort, SerialPortNumber, -}; use propolis_client::{ - types::{InstanceInitializationMethod, InstanceSpecV0}, + types::{ + Board, Chipset, ComponentV0, InstanceInitializationMethod, + InstanceSpecV0, SerialPort, SerialPortNumber, + }, Client as PropolisClient, VolumeConstructionRequest, }; use sled_agent_api::SupportBundleMetadata; @@ -129,7 +129,7 @@ fn extract_targets_from_volume_construction_request( VolumeConstructionRequest::Region { opts, .. } => { for target in &opts.target { - res.push(target.clone()); + res.push(*target); } }