diff --git a/dev-tools/reconfigurator-cli/src/lib.rs b/dev-tools/reconfigurator-cli/src/lib.rs index 93289ef2cce..05b2d378996 100644 --- a/dev-tools/reconfigurator-cli/src/lib.rs +++ b/dev-tools/reconfigurator-cli/src/lib.rs @@ -36,7 +36,6 @@ use nexus_types::deployment::{ use nexus_types::deployment::{BlueprintZoneImageVersion, PendingMgsUpdate}; use nexus_types::external_api::views::SledPolicy; use nexus_types::external_api::views::SledProvisionPolicy; -use nexus_types::inventory::SpType; use omicron_common::address::REPO_DEPOT_PORT; use omicron_common::api::external::Generation; use omicron_common::api::external::Name; @@ -56,11 +55,9 @@ use std::fmt::Write; use std::io::IsTerminal; use swrite::{SWrite, swriteln}; use tabled::Tabled; +use tufaceous_artifact::ArtifactHash; use tufaceous_artifact::ArtifactVersion; use tufaceous_artifact::ArtifactVersionError; -use tufaceous_artifact::{ - ArtifactHash, ArtifactHashId, ArtifactKind, KnownArtifactKind, -}; mod log_capture; @@ -919,27 +916,16 @@ fn cmd_blueprint_edit( anyhow!("unknown baseboard serial: {serial:?}") })?; - let (known_artifact_kind, details) = match component { + let details = match component { SpUpdateComponent::Sp { expected_active_version, expected_inactive_version, - } => { - let known_artifact_kind = match sp.sp_type { - SpType::Sled => KnownArtifactKind::GimletSp, - SpType::Power => KnownArtifactKind::PscSp, - SpType::Switch => KnownArtifactKind::SwitchSp, - }; - let details = PendingMgsUpdateDetails::Sp { - expected_active_version, - expected_inactive_version, - }; - (known_artifact_kind, details) - } + } => PendingMgsUpdateDetails::Sp { + expected_active_version, + expected_inactive_version, + }, }; - let artifact_kind = ArtifactKind::from_known(known_artifact_kind); - let artifact_hash_id = - ArtifactHashId { kind: artifact_kind, hash: artifact_hash }; let artifact_version = ArtifactVersion::new(version) .context("parsing artifact version")?; @@ -948,7 +934,7 @@ fn cmd_blueprint_edit( sp_type: sp.sp_type, slot_id: u32::from(sp.sp_slot), details, - artifact_hash_id, + artifact_hash, artifact_version, }; diff --git a/dev-tools/reconfigurator-cli/tests/output/cmd-set-mgs-updates-stdout b/dev-tools/reconfigurator-cli/tests/output/cmd-set-mgs-updates-stdout index c1f1091752f..24b28919cbc 100644 --- a/dev-tools/reconfigurator-cli/tests/output/cmd-set-mgs-updates-stdout +++ b/dev-tools/reconfigurator-cli/tests/output/cmd-set-mgs-updates-stdout @@ -367,10 +367,10 @@ parent: ad97e762-7bf1-45a6-a98f-60afb7e491c0 PENDING MGS-MANAGED UPDATES: 1 Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } @@ -548,10 +548,10 @@ to: blueprint cca24b71-09b5-4042-9185-b33e9f2ebba0 PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -+ sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ++ sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } internal DNS: @@ -848,10 +848,10 @@ to: blueprint ad97e762-7bf1-45a6-a98f-60afb7e491c0 PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +- sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 1.1.0 Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } internal DNS: @@ -1158,10 +1158,10 @@ parent: cca24b71-09b5-4042-9185-b33e9f2ebba0 PENDING MGS-MANAGED UPDATES: 1 Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } @@ -1339,11 +1339,11 @@ to: blueprint 5bf974f3-81f9-455b-b24e-3099f765664c PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - 1.1.0 - Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } - └─ + newest + Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +* sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - 1.1.0 - Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } + └─ + newest + Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } internal DNS: @@ -1640,11 +1640,11 @@ to: blueprint cca24b71-09b5-4042-9185-b33e9f2ebba0 PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -* sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - newest - Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } - └─ + 1.1.0 + Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +* sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - newest - Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } + └─ + 1.1.0 + Sp { expected_active_version: ArtifactVersion("1.0.0"), expected_inactive_version: Version(ArtifactVersion("1.0.1")) } internal DNS: @@ -1953,11 +1953,11 @@ parent: 5bf974f3-81f9-455b-b24e-3099f765664c PENDING MGS-MANAGED UPDATES: 2 Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sled 0 model0 serial0 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } - sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 0 model0 serial0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } + sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } @@ -2135,11 +2135,11 @@ to: blueprint 1b837a27-3be1-4fcb-8499-a921c839e1d0 PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } -+ sled 0 model0 serial0 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } ++ sled 0 model0 serial0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } internal DNS: @@ -2443,10 +2443,10 @@ parent: 1b837a27-3be1-4fcb-8499-a921c839e1d0 PENDING MGS-MANAGED UPDATES: 1 Pending MGS-managed updates (all baseboards): - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sled 0 model0 serial0 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 0 model0 serial0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } @@ -2624,11 +2624,11 @@ to: blueprint 3682a71b-c6ca-4b7e-8f84-16df80c85960 PENDING MGS UPDATES: Pending MGS-managed updates (all baseboards): - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sp_type slot part_number serial_number artifact_kind artifact_hash artifact_version details - --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - sled 0 model0 serial0 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } -- sled 2 model2 serial2 gimlet_sp e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sp_type slot part_number serial_number artifact_hash artifact_version details + ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + sled 0 model0 serial0 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 three Sp { expected_active_version: ArtifactVersion("two"), expected_inactive_version: NoValidVersion } +- sled 2 model2 serial2 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 newest Sp { expected_active_version: ArtifactVersion("newer"), expected_inactive_version: Version(ArtifactVersion("older")) } internal DNS: diff --git a/dev-tools/reconfigurator-sp-updater/src/main.rs b/dev-tools/reconfigurator-sp-updater/src/main.rs index 1099ae2d8c8..33257e9fa54 100644 --- a/dev-tools/reconfigurator-sp-updater/src/main.rs +++ b/dev-tools/reconfigurator-sp-updater/src/main.rs @@ -34,10 +34,7 @@ use std::sync::Arc; use std::time::Duration; use tokio::sync::watch; use tufaceous_artifact::ArtifactHash; -use tufaceous_artifact::ArtifactHashId; -use tufaceous_artifact::ArtifactKind; use tufaceous_artifact::ArtifactVersion; -use tufaceous_artifact::KnownArtifactKind; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { @@ -309,7 +306,7 @@ fn cmd_config( update.sp_type, update.slot_id, )?; - writeln!(&mut s, " artifact hash: {}", update.artifact_hash_id,)?; + writeln!(&mut s, " artifact hash: {}", update.artifact_hash)?; writeln!( &mut s, " user-provided artifact version: {}", @@ -357,11 +354,7 @@ fn cmd_status( )?; writeln!(&mut s, " attempt#: {}", r.nattempts_done)?; writeln!(&mut s, " version: {}", r.request.artifact_version)?; - writeln!( - &mut s, - " hash: {}", - r.request.artifact_hash_id.hash - )?; + writeln!(&mut s, " hash: {}", r.request.artifact_hash,)?; writeln!(&mut s, " result: {:?}", r.result)?; } @@ -424,14 +417,6 @@ fn cmd_set( ) -> anyhow::Result> { let serial = &args.serial; let info = updater_state.inventory.info_for_serial(serial)?; - let known_artifact_kind = match (&args.component, info.sp_type) { - (Component::Sp { .. }, SpType::Sled) => KnownArtifactKind::GimletSp, - (Component::Sp { .. }, SpType::Power) => KnownArtifactKind::PscSp, - (Component::Sp { .. }, SpType::Switch) => KnownArtifactKind::SwitchSp, - }; - let artifact_kind = ArtifactKind::from_known(known_artifact_kind); - let artifact_hash_id = - ArtifactHashId { kind: artifact_kind, hash: args.artifact_hash }; let request = PendingMgsUpdate { baseboard_id: info.baseboard_id.clone(), sp_type: info.sp_type, @@ -445,7 +430,7 @@ fn cmd_set( expected_inactive_version, }, }, - artifact_hash_id, + artifact_hash: args.artifact_hash, artifact_version: ArtifactVersion::new(args.version) .context("parsing artifact version")?, }; diff --git a/nexus/mgs-updates/src/driver_update.rs b/nexus/mgs-updates/src/driver_update.rs index d695ab3aa98..a4a896f3aa4 100644 --- a/nexus/mgs-updates/src/driver_update.rs +++ b/nexus/mgs-updates/src/driver_update.rs @@ -162,8 +162,7 @@ pub(crate) async fn apply_update( }; // Obtain the contents of the artifact that we need. - let data = - artifacts.artifact_contents(&update.artifact_hash_id.hash).await?; + let data = artifacts.artifact_contents(&update.artifact_hash).await?; debug!(log, "loaded artifact contents"); // Check the live state first to see if: diff --git a/nexus/types/src/deployment.rs b/nexus/types/src/deployment.rs index 47922e5dddd..769f74a46f7 100644 --- a/nexus/types/src/deployment.rs +++ b/nexus/types/src/deployment.rs @@ -54,7 +54,6 @@ use std::net::Ipv6Addr; use std::net::SocketAddrV6; use strum::EnumIter; use tufaceous_artifact::ArtifactHash; -use tufaceous_artifact::ArtifactHashId; use tufaceous_artifact::ArtifactVersion; use tufaceous_artifact::ArtifactVersionError; @@ -1193,7 +1192,7 @@ pub struct PendingMgsUpdate { /// which artifact to apply to this device /// (implies which component is being updated) - pub artifact_hash_id: ArtifactHashId, + pub artifact_hash: ArtifactHash, pub artifact_version: ArtifactVersion, } @@ -1208,13 +1207,9 @@ impl slog::KV for PendingMgsUpdate { .emit_str(Key::from("sp_type"), &format!("{:?}", self.sp_type))?; serializer.emit_u32(Key::from("sp_slot"), self.slot_id)?; slog::KV::serialize(&self.details, record, serializer)?; - serializer.emit_str( - Key::from("artifact_kind"), - &self.artifact_hash_id.kind.as_str(), - )?; serializer.emit_str( Key::from("artifact_hash"), - &self.artifact_hash_id.hash.to_string(), + &self.artifact_hash.to_string(), ) } } @@ -1233,8 +1228,7 @@ impl PendingMgsUpdate { self.slot_id.to_string(), self.baseboard_id.part_number.clone(), self.baseboard_id.serial_number.clone(), - self.artifact_hash_id.kind.to_string(), - self.artifact_hash_id.hash.to_string(), + self.artifact_hash.to_string(), self.artifact_version.to_string(), format!("{:?}", self.details), ] @@ -1688,9 +1682,6 @@ mod test { use crate::inventory::BaseboardId; use gateway_client::types::SpType; use std::sync::Arc; - use tufaceous_artifact::ArtifactHashId; - use tufaceous_artifact::ArtifactKind; - use tufaceous_artifact::KnownArtifactKind; #[test] fn test_serialize_pending_mgs_updates() { @@ -1718,10 +1709,7 @@ mod test { "1.0.36".parse().unwrap(), ), }, - artifact_hash_id: ArtifactHashId { - kind: ArtifactKind::from_known(KnownArtifactKind::GimletSp), - hash: "47266ede81e13f5f1e36623ea8dd963842606b783397e4809a9a5f0bda0f8170".parse().unwrap(), - }, + artifact_hash: "47266ede81e13f5f1e36623ea8dd963842606b783397e4809a9a5f0bda0f8170".parse().unwrap(), artifact_version: "1.0.34".parse().unwrap(), }; pending_mgs_updates.insert(update); diff --git a/nexus/types/src/deployment/blueprint_diff.rs b/nexus/types/src/deployment/blueprint_diff.rs index 6b375ac9c10..9893ccbc41d 100644 --- a/nexus/types/src/deployment/blueprint_diff.rs +++ b/nexus/types/src/deployment/blueprint_diff.rs @@ -1633,14 +1633,8 @@ impl<'a> BpDiffPendingMgsUpdates<'a> { &u1.baseboard_id.serial_number, &u2.baseboard_id.serial_number, ); - let artifact_kind = BpTableColumn::new( - &u1.artifact_hash_id.kind, - &u2.artifact_hash_id.kind, - ); - let artifact_hash = BpTableColumn::new( - &u1.artifact_hash_id.hash, - &u2.artifact_hash_id.hash, - ); + let artifact_hash = + BpTableColumn::new(&u1.artifact_hash, &u2.artifact_hash); let artifact_version = BpTableColumn::new(&u1.artifact_version, &u2.artifact_version); let details = if u1.details != u2.details { @@ -1658,7 +1652,6 @@ impl<'a> BpDiffPendingMgsUpdates<'a> { slot_id, part_number, serial_number, - artifact_kind, artifact_hash, artifact_version, details, diff --git a/nexus/types/src/deployment/blueprint_display.rs b/nexus/types/src/deployment/blueprint_display.rs index 02c83749b51..3cc6346f0ff 100644 --- a/nexus/types/src/deployment/blueprint_display.rs +++ b/nexus/types/src/deployment/blueprint_display.rs @@ -419,7 +419,6 @@ impl BpTableSchema for BpPendingMgsUpdates { "slot", "part_number", "serial_number", - "artifact_kind", "artifact_hash", "artifact_version", "details", diff --git a/openapi/nexus-internal.json b/openapi/nexus-internal.json index ea5ce81f65b..abe71b4b091 100644 --- a/openapi/nexus-internal.json +++ b/openapi/nexus-internal.json @@ -1620,25 +1620,6 @@ } ] }, - "ArtifactHashId": { - "description": "A hash-based identifier for an artifact or deployment unit: the kind and hash.", - "type": "object", - "properties": { - "hash": { - "description": "The hash of the artifact.", - "type": "string", - "format": "hex string (32 bytes)" - }, - "kind": { - "description": "The kind of artifact this is.", - "type": "string" - } - }, - "required": [ - "hash", - "kind" - ] - }, "ArtifactVersion": { "description": "An artifact version.\n\nThis is a freeform identifier with some basic validation. It may be the serialized form of a semver version, or a custom identifier that uses the same character set as a semver, plus `_`.\n\nThe exact pattern accepted is `^[a-zA-Z0-9._+-]{1,63}$`.\n\n# Ord implementation\n\n`ArtifactVersion`s are not intended to be sorted, just compared for equality. `ArtifactVersion` implements `Ord` only for storage within sorted collections.", "type": "string", @@ -4880,13 +4861,10 @@ "PendingMgsUpdate": { "type": "object", "properties": { - "artifact_hash_id": { + "artifact_hash": { "description": "which artifact to apply to this device (implies which component is being updated)", - "allOf": [ - { - "$ref": "#/components/schemas/ArtifactHashId" - } - ] + "type": "string", + "format": "hex string (32 bytes)" }, "artifact_version": { "$ref": "#/components/schemas/ArtifactVersion" @@ -4923,7 +4901,7 @@ } }, "required": [ - "artifact_hash_id", + "artifact_hash", "artifact_version", "baseboard_id", "details",