Skip to content

Commit 4d42838

Browse files
committed
the great type migration continues
1 parent 745d1b7 commit 4d42838

File tree

15 files changed

+392
-466
lines changed

15 files changed

+392
-466
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev-tools/ls-apis/tests/api_dependencies.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Bootstrap Agent (client: bootstrap-agent-client)
22
consumed by: omicron-sled-agent (omicron/sled-agent) via 1 path
3-
consumed by: wicketd (omicron/wicketd) via 2 paths
3+
consumed by: wicketd (omicron/wicketd) via 1 path
44

55
Bootstrap Agent Lockstep API (client: bootstrap-agent-lockstep-client)
6-
consumed by: wicketd (omicron/wicketd) via 1 path
6+
consumed by: wicketd (omicron/wicketd) via 2 paths
77

88
Clickhouse Cluster Admin for Keepers (client: clickhouse-admin-keeper-client)
99
consumed by: omicron-nexus (omicron/nexus) via 3 paths

openapi/bootstrap-agent-lockstep.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@
722722
"description": "Password hashes must be in PHC (Password Hashing Competition) string format. Passwords must be hashed with Argon2id. Password hashes may be rejected if the parameters appear not to be secure enough.",
723723
"type": "string"
724724
},
725-
"PortConfigV2": {
725+
"PortConfig": {
726726
"type": "object",
727727
"properties": {
728728
"addresses": {
@@ -909,7 +909,7 @@
909909
"description": "Initial rack network configuration.",
910910
"allOf": [
911911
{
912-
"$ref": "#/components/schemas/RackNetworkConfigV2"
912+
"$ref": "#/components/schemas/RackNetworkConfig"
913913
}
914914
]
915915
},
@@ -942,7 +942,7 @@
942942
"recovery_silo"
943943
]
944944
},
945-
"RackNetworkConfigV2": {
945+
"RackNetworkConfig": {
946946
"description": "Initial network configuration",
947947
"type": "object",
948948
"properties": {
@@ -975,7 +975,7 @@
975975
"description": "Uplinks for connecting the rack to external networks",
976976
"type": "array",
977977
"items": {
978-
"$ref": "#/components/schemas/PortConfigV2"
978+
"$ref": "#/components/schemas/PortConfig"
979979
}
980980
},
981981
"rack_subnet": {

openapi/nexus-lockstep.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7281,7 +7281,7 @@
72817281
"waiting_zones"
72827282
]
72837283
},
7284-
"PortConfigV2": {
7284+
"PortConfig": {
72857285
"type": "object",
72867286
"properties": {
72877287
"addresses": {
@@ -7834,7 +7834,7 @@
78347834
"description": "Initial rack network configuration",
78357835
"allOf": [
78367836
{
7837-
"$ref": "#/components/schemas/RackNetworkConfigV2"
7837+
"$ref": "#/components/schemas/RackNetworkConfig"
78387838
}
78397839
]
78407840
},
@@ -7869,7 +7869,7 @@
78697869
"zpools"
78707870
]
78717871
},
7872-
"RackNetworkConfigV2": {
7872+
"RackNetworkConfig": {
78737873
"description": "Initial network configuration",
78747874
"type": "object",
78757875
"properties": {
@@ -7902,7 +7902,7 @@
79027902
"description": "Uplinks for connecting the rack to external networks",
79037903
"type": "array",
79047904
"items": {
7905-
"$ref": "#/components/schemas/PortConfigV2"
7905+
"$ref": "#/components/schemas/PortConfig"
79067906
}
79077907
},
79087908
"rack_subnet": {

openapi/wicketd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7703,7 +7703,7 @@
77037703
}
77047704
},
77057705
"UserSpecifiedPortConfig": {
7706-
"description": "User-specified version of [`PortConfigV2`].\n\nAll of [`PortConfigV2`] is user-specified. But we expect the port name to be a key, rather than a field as in [`PortConfigV2`]. So this has all of the fields other than the port name.\n\n[`PortConfigV2`]: omicron_common::api::internal::shared::PortConfigV2",
7706+
"description": "User-specified version of [`PortConfig`].\n\nAll of [`PortConfig`] is user-specified. But we expect the port name to be a key, rather than a field as in [`PortConfig`]. So this has all of the fields other than the port name.\n\n[`PortConfig`]: omicron_common::api::internal::shared::PortConfig",
77077707
"type": "object",
77087708
"properties": {
77097709
"addresses": {

sled-agent/src/bin/sled-agent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use omicron_sled_agent::bootstrap::RssAccessError;
1313
use omicron_sled_agent::bootstrap::server as bootstrap_server;
1414
use omicron_sled_agent::config::Config as SledConfig;
1515
use sled_agent_types::rack_init::{
16-
RackInitializeRequest, RackInitializeRequestParams,
16+
RackInitializeRequestParams, rack_initialize_request_from_file,
1717
};
1818

1919
#[derive(Debug, Parser)]
@@ -64,7 +64,7 @@ async fn do_run() -> Result<(), CmdError> {
6464
};
6565
let rss_config = if rss_config_path.exists() {
6666
let rss_config =
67-
RackInitializeRequest::from_file(rss_config_path)
67+
rack_initialize_request_from_file(rss_config_path)
6868
.map_err(|e| CmdError::Failure(anyhow!(e)))?;
6969
let skip_timesync = config.skip_timesync.unwrap_or(false);
7070
Some(RackInitializeRequestParams::new(

sled-agent/src/rack_setup/service.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -867,14 +867,14 @@ impl ServiceInner {
867867

868868
let rack_network_config = {
869869
let config = &config.rack_network_config;
870-
NexusTypes::RackNetworkConfigV2 {
870+
NexusTypes::RackNetworkConfig {
871871
rack_subnet: config.rack_subnet,
872872
infra_ip_first: config.infra_ip_first,
873873
infra_ip_last: config.infra_ip_last,
874874
ports: config
875875
.ports
876876
.iter()
877-
.map(|config| NexusTypes::PortConfigV2 {
877+
.map(|config| NexusTypes::PortConfig {
878878
port: config.port.clone(),
879879
routes: config
880880
.routes
@@ -1728,6 +1728,7 @@ mod test {
17281728
Inventory, InventoryDisk, OmicronZoneType, SledCpuFamily, SledRole,
17291729
ZoneImageResolverInventory,
17301730
};
1731+
use sled_agent_types::rack_init::rack_initialize_request_test_config;
17311732

17321733
fn make_sled_info(
17331734
sled_id: SledUuid,
@@ -1803,7 +1804,7 @@ mod test {
18031804
}
18041805

18051806
fn make_test_service_plan() -> ServicePlan {
1806-
let rss_config = Config::test_config();
1807+
let rss_config = rack_initialize_request_test_config();
18071808
let fake_sleds = make_fake_sleds();
18081809
let service_plan =
18091810
ServicePlan::create_transient(&rss_config, fake_sleds)
@@ -1934,7 +1935,7 @@ mod test {
19341935

19351936
let fake_sleds = make_fake_sleds();
19361937

1937-
let rss_config = Config::test_config();
1938+
let rss_config = rack_initialize_request_test_config();
19381939
let service_plan =
19391940
ServicePlan::create_transient(&rss_config, fake_sleds)
19401941
.expect("created service plan");

sled-agent/src/sim/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use nexus_config::NUM_INITIAL_RESERVED_IP_ADDRESSES;
2828
use nexus_lockstep_client::types::{
2929
AllowedSourceIps, CrucibleDatasetCreateRequest, ExternalPortDiscovery,
3030
IpRange, Ipv4Range, Ipv6Range, RackInitializationRequest,
31-
RackNetworkConfigV2,
31+
RackNetworkConfig,
3232
};
3333
use nexus_types::deployment::{
3434
BlueprintPhysicalDiskConfig, BlueprintPhysicalDiskDisposition,
@@ -635,7 +635,7 @@ pub async fn run_standalone_server(
635635
external_dns_zone_name: DNS_ZONE_EXTERNAL_TESTING.to_owned(),
636636
recovery_silo,
637637
external_port_count: ExternalPortDiscovery::Static(HashMap::new()),
638-
rack_network_config: RackNetworkConfigV2 {
638+
rack_network_config: RackNetworkConfig {
639639
rack_subnet: Ipv6Net::host_net(Ipv6Addr::LOCALHOST),
640640
infra_ip_first: Ipv4Addr::LOCALHOST,
641641
infra_ip_last: Ipv4Addr::LOCALHOST,

0 commit comments

Comments
 (0)