Skip to content

Commit

Permalink
Bump gateway-messages
Browse files Browse the repository at this point in the history
This is a dependency for some upcoming work
  • Loading branch information
labbott committed May 1, 2024
1 parent d901636 commit f1531ce
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 57 deletions.
74 changes: 37 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ foreign-types = "0.3.2"
fs-err = "2.11.0"
futures = "0.3.30"
gateway-client = { path = "clients/gateway-client" }
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "2739c18e80697aa6bc235c935176d14b4d757ee9", default-features = false, features = ["std"] }
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "2739c18e80697aa6bc235c935176d14b4d757ee9" }
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762", default-features = false, features = ["std"] }
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762" }
gateway-test-utils = { path = "gateway-test-utils" }
gethostname = "0.4.3"
glob = "0.3.1"
Expand Down
7 changes: 5 additions & 2 deletions gateway/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ pub struct SpState {
pub hubris_archive_id: String,
pub base_mac_address: [u8; 6],
pub power_state: PowerState,
pub rot: RotState,
// SpStateV3 of gateway-messages decoupled RoT state
pub rot: Option<RotState>,
}

#[derive(
Expand Down Expand Up @@ -1044,7 +1045,9 @@ async fn sp_component_reset(
let component = component_from_str(&component)?;

sp.reset_component_prepare(component)
.and_then(|()| sp.reset_component_trigger(component))
// We always want to run with the watchdog when resetting as
// disabling the watchdog should be considered a debug only feature
.and_then(|()| sp.reset_component_trigger(component, false))
.await
.map_err(|err| SpCommsError::SpCommunicationFailed {
sp: sp_id,
Expand Down
19 changes: 17 additions & 2 deletions gateway/src/http_entrypoints/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl From<gateway_messages::SpStateV1> for SpState {
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: RotState::from(state.rot),
rot: Some(RotState::from(state.rot)),
}
}
}
Expand All @@ -166,7 +166,21 @@ impl From<gateway_messages::SpStateV2> for SpState {
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: RotState::from(state.rot),
rot: Some(RotState::from(state.rot)),
}
}
}

impl From<gateway_messages::SpStateV3> for SpState {
fn from(state: gateway_messages::SpStateV3) -> Self {
Self {
serial_number: stringify_byte_string(&state.serial_number),
model: stringify_byte_string(&state.model),
revision: state.revision,
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: None,
}
}
}
Expand All @@ -176,6 +190,7 @@ impl From<gateway_sp_comms::VersionedSpState> for SpState {
match value {
gateway_sp_comms::VersionedSpState::V1(s) => Self::from(s),
gateway_sp_comms::VersionedSpState::V2(s) => Self::from(s),
gateway_sp_comms::VersionedSpState::V3(s) => Self::from(s),
}
}
}
Expand Down

0 comments on commit f1531ce

Please sign in to comment.