Skip to content

Commit 8e0bed8

Browse files
authored
[reconfigurator] Replace todo!s with error returns (#7552)
These were supposed to be fixed before merging #7495, but were not. Both of these are of the flavor "should never happen unless there's an internal bug" and could arguably be `debug_assert`s, but having the option for Nexus panics due to internal bugs here is not awesome.
1 parent 8649aa8 commit 8e0bed8

File tree

1 file changed

+12
-2
lines changed
  • nexus/reconfigurator/planning/src/blueprint_builder

1 file changed

+12
-2
lines changed

nexus/reconfigurator/planning/src/blueprint_builder/builder.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,13 +925,23 @@ impl<'a> BlueprintBuilder<'a> {
925925
match zone.disposition {
926926
BlueprintZoneDisposition::Expunged => (),
927927
BlueprintZoneDisposition::InService
928-
| BlueprintZoneDisposition::Quiesced => todo!("fixme-1"),
928+
| BlueprintZoneDisposition::Quiesced => {
929+
return Err(Error::Planner(anyhow!(
930+
"expunged all disks but a zone \
931+
is still in service: {zone:?}"
932+
)));
933+
}
929934
}
930935
}
931936
for dataset in editor.datasets(BlueprintDatasetFilter::All) {
932937
match dataset.disposition {
933938
BlueprintDatasetDisposition::Expunged => (),
934-
BlueprintDatasetDisposition::InService => todo!("fixme-2"),
939+
BlueprintDatasetDisposition::InService => {
940+
return Err(Error::Planner(anyhow!(
941+
"expunged all disks but a dataset \
942+
is still in service: {dataset:?}"
943+
)));
944+
}
935945
}
936946
}
937947

0 commit comments

Comments
 (0)