@@ -11,11 +11,8 @@ use internal_dns_resolver::Resolver;
1111use nexus_db_queries:: context:: OpContext ;
1212use nexus_db_queries:: db:: DataStore ;
1313use nexus_types:: deployment:: Blueprint ;
14- use nexus_types:: deployment:: BlueprintPhysicalDiskDisposition ;
15- use nexus_types:: deployment:: BlueprintZoneDisposition ;
1614use nexus_types:: deployment:: SledFilter ;
1715use nexus_types:: deployment:: execution:: * ;
18- use nexus_types:: external_api:: views:: SledState ;
1916use nexus_types:: identity:: Asset ;
2017use omicron_uuid_kinds:: GenericUuid ;
2118use omicron_uuid_kinds:: OmicronZoneUuid ;
@@ -246,7 +243,7 @@ fn register_zone_external_networking_step<'a>(
246243 move |_cx| async move {
247244 datastore
248245 . blueprint_ensure_external_networking_resources (
249- & opctx, blueprint,
246+ opctx, blueprint,
250247 )
251248 . await
252249 . map_err ( |err| anyhow ! ( err) ) ?;
@@ -271,7 +268,7 @@ fn register_support_bundle_failure_step<'a>(
271268 an expunged disk or sled",
272269 move |_cx| async move {
273270 let res = match datastore
274- . support_bundle_fail_expunged ( & opctx, blueprint, nexus_id)
271+ . support_bundle_fail_expunged ( opctx, blueprint, nexus_id)
275272 . await
276273 {
277274 Ok ( report) => StepSuccess :: new ( ( ) )
@@ -298,7 +295,7 @@ fn register_sled_list_step<'a>(
298295 "Fetch sled list" ,
299296 move |_cx| async move {
300297 let sleds_by_id: BTreeMap < SledUuid , _ > = datastore
301- . sled_list_all_batched ( & opctx, SledFilter :: InService )
298+ . sled_list_all_batched ( opctx, SledFilter :: InService )
302299 . await
303300 . context ( "listing all sleds" ) ?
304301 . into_iter ( )
@@ -329,7 +326,7 @@ fn register_deploy_disks_step<'a>(
329326 move |cx| async move {
330327 let sleds_by_id = sleds. into_value ( cx. token ( ) ) . await ;
331328 let res = omicron_physical_disks:: deploy_disks (
332- & opctx,
329+ opctx,
333330 & sleds_by_id,
334331 blueprint
335332 . sleds
@@ -356,15 +353,10 @@ fn register_deploy_datasets_step<'a>(
356353 "Deploy datasets" ,
357354 move |cx| async move {
358355 let sleds_by_id = sleds. into_value ( cx. token ( ) ) . await ;
359- let res = datasets:: deploy_datasets (
360- & opctx,
361- & sleds_by_id,
362- blueprint. sleds . iter ( ) . map ( |( sled_id, sled) | {
363- ( * sled_id, & sled. datasets_config )
364- } ) ,
365- )
366- . await
367- . map_err ( merge_anyhow_list) ;
356+ let res =
357+ datasets:: deploy_datasets ( opctx, & sleds_by_id, blueprint)
358+ . await
359+ . map_err ( merge_anyhow_list) ;
368360 Ok ( map_err_to_step_warning ( res) )
369361 } ,
370362 )
@@ -384,7 +376,7 @@ fn register_deploy_zones_step<'a>(
384376 move |cx| async move {
385377 let sleds_by_id = sleds. into_value ( cx. token ( ) ) . await ;
386378 let res = omicron_zones:: deploy_zones (
387- & opctx,
379+ opctx,
388380 & sleds_by_id,
389381 blueprint
390382 . sleds
@@ -418,9 +410,9 @@ fn register_plumb_firewall_rules_step<'a>(
418410 move |_cx| async move {
419411 let res = nexus_networking:: plumb_service_firewall_rules (
420412 datastore,
421- & opctx,
413+ opctx,
422414 & [ ] ,
423- & opctx,
415+ opctx,
424416 & opctx. log ,
425417 )
426418 . await
@@ -448,7 +440,7 @@ fn register_dns_records_step<'a>(
448440 let sleds_by_id = sleds. into_value ( cx. token ( ) ) . await ;
449441
450442 let res = dns:: deploy_dns (
451- & opctx,
443+ opctx,
452444 datastore,
453445 nexus_id. to_string ( ) ,
454446 blueprint,
@@ -476,12 +468,7 @@ fn register_cleanup_expunged_zones_step<'a>(
476468 "Cleanup expunged zones" ,
477469 move |_cx| async move {
478470 let res = omicron_zones:: clean_up_expunged_zones (
479- & opctx,
480- datastore,
481- resolver,
482- blueprint. all_omicron_zones (
483- BlueprintZoneDisposition :: is_ready_for_cleanup,
484- ) ,
471+ opctx, datastore, resolver, blueprint,
485472 )
486473 . await
487474 . map_err ( merge_anyhow_list) ;
@@ -502,19 +489,10 @@ fn register_decommission_sleds_step<'a>(
502489 ExecutionStepId :: Cleanup ,
503490 "Decommission sleds" ,
504491 move |_cx| async move {
505- let res = sled_state:: decommission_sleds (
506- & opctx,
507- datastore,
508- blueprint
509- . sleds
510- . iter ( )
511- . filter ( |( _, sled) | {
512- sled. state == SledState :: Decommissioned
513- } )
514- . map ( |( & sled_id, _) | sled_id) ,
515- )
516- . await
517- . map_err ( merge_anyhow_list) ;
492+ let res =
493+ sled_state:: decommission_sleds ( opctx, datastore, blueprint)
494+ . await
495+ . map_err ( merge_anyhow_list) ;
518496 Ok ( map_err_to_step_warning ( res) )
519497 } ,
520498 )
@@ -533,11 +511,7 @@ fn register_decommission_disks_step<'a>(
533511 "Decommission expunged disks" ,
534512 move |_cx| async move {
535513 let res = omicron_physical_disks:: decommission_expunged_disks (
536- & opctx,
537- datastore,
538- blueprint
539- . all_omicron_disks ( BlueprintPhysicalDiskDisposition :: is_ready_for_cleanup)
540- . map ( |( sled_id, config) | ( sled_id, config. id ) ) ,
514+ opctx, datastore, blueprint,
541515 )
542516 . await
543517 . map_err ( merge_anyhow_list) ;
@@ -561,9 +535,8 @@ fn register_deploy_clickhouse_cluster_nodes_step<'a>(
561535 & blueprint. clickhouse_cluster_config
562536 {
563537 let res = clickhouse:: deploy_nodes (
564- & opctx,
565- blueprint
566- . all_omicron_zones ( BlueprintZoneDisposition :: any) ,
538+ opctx,
539+ blueprint,
567540 & clickhouse_cluster_config,
568541 )
569542 . await
@@ -587,15 +560,8 @@ fn register_deploy_clickhouse_single_node_step<'a>(
587560 ExecutionStepId :: Ensure ,
588561 "Deploy single-node clickhouse cluster" ,
589562 move |_cx| async move {
590- let res = clickhouse:: deploy_single_node (
591- & opctx,
592- blueprint
593- . all_omicron_zones (
594- BlueprintZoneDisposition :: is_in_service,
595- )
596- . filter ( |( _, z) | z. zone_type . is_clickhouse ( ) ) ,
597- )
598- . await ;
563+ let res =
564+ clickhouse:: deploy_single_node ( opctx, blueprint) . await ;
599565 Ok ( map_err_to_step_warning ( res) )
600566 } ,
601567 )
@@ -620,7 +586,7 @@ fn register_reassign_sagas_step<'a>(
620586 // affect anything else.
621587 let sec_id = nexus_db_model:: SecId :: from ( nexus_id) ;
622588 let reassigned = sagas:: reassign_sagas_from_expunged (
623- & opctx, datastore, blueprint, sec_id,
589+ opctx, datastore, blueprint, sec_id,
624590 )
625591 . await
626592 . context ( "failed to re-assign sagas" ) ;
@@ -649,7 +615,7 @@ fn register_cockroachdb_settings_step<'a>(
649615 "Ensure CockroachDB settings" ,
650616 move |_cx| async move {
651617 let res =
652- cockroachdb:: ensure_settings ( & opctx, datastore, blueprint)
618+ cockroachdb:: ensure_settings ( opctx, datastore, blueprint)
653619 . await ;
654620 Ok ( map_err_to_step_warning ( res) )
655621 } ,
0 commit comments