Skip to content

Commit

Permalink
[reconfigurator] Add dataset disposition to blueprint diffs (#7497)
Browse files Browse the repository at this point in the history
Fixes #7302, I think! (The issue is titled generically, but the
specifics are about dataset diffs, which are fixed by this PR.)

The diff is large because of expectorate. The code changes are _heavily_
modified after our existing `ModifiedZone` / zone error stuff (largely
"copy, paste, s/zone/dataset/").
  • Loading branch information
jgallagher authored Feb 7, 2025
1 parent 6dbd673 commit 046c87f
Show file tree
Hide file tree
Showing 17 changed files with 2,282 additions and 2,096 deletions.
18 changes: 9 additions & 9 deletions dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -1514,15 +1514,15 @@ to: blueprint ......<REDACTED_BLUEPRINT_ID>.......


datasets at generation 2:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dataset name dataset uuid quota reservation compression
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_clickhouse_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_cockroachdb_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_crucible_pantry_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_external_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_internal_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... none none off
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dataset name dataset id disposition quota reservation compression
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_clickhouse_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_cockroachdb_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_crucible_pantry_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_external_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_internal_dns_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off
oxp_..........<REDACTED_UUID>.........../crypt/zone/oxz_nexus_..........<REDACTED_UUID>........... ..........<REDACTED_UUID>........... in service none none off


omicron zones at generation 2:
Expand Down
340 changes: 170 additions & 170 deletions nexus/reconfigurator/planning/tests/output/planner_basic_add_sled_2_3.txt

Large diffs are not rendered by default.

380 changes: 190 additions & 190 deletions nexus/reconfigurator/planning/tests/output/planner_basic_add_sled_3_5.txt

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions nexus/types/src/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,17 @@ impl BlueprintDatasetDisposition {
}
}

impl fmt::Display for BlueprintDatasetDisposition {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
// Neither `write!(f, "...")` nor `f.write_str("...")` obey fill
// and alignment (used above), but this does.
BlueprintDatasetDisposition::InService => "in service".fmt(f),
BlueprintDatasetDisposition::Expunged => "expunged".fmt(f),
}
}
}

/// Information about a dataset as recorded in a blueprint
#[derive(
Debug,
Expand All @@ -1028,9 +1039,7 @@ impl BlueprintDatasetDisposition {
Diffable,
)]
pub struct BlueprintDatasetConfig {
// TODO: Display this in diffs - leave for now, for backwards compat
pub disposition: BlueprintDatasetDisposition,

pub id: DatasetUuid,
pub pool: ZpoolName,
pub kind: DatasetKind,
Expand Down Expand Up @@ -1063,6 +1072,7 @@ impl BlueprintDatasetConfig {
vec![
DatasetName::new(self.pool.clone(), self.kind.clone()).full_name(),
self.id.to_string(),
self.disposition.to_string(),
unwrap_or_none(&self.quota),
unwrap_or_none(&self.reservation),
self.compression.to_string(),
Expand Down
Loading

0 comments on commit 046c87f

Please sign in to comment.