Skip to content

Commit

Permalink
Address final review comments
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
sunshowers committed Oct 6, 2023
2 parents 396af26 + cf3bdae commit 27013e4
Show file tree
Hide file tree
Showing 29 changed files with 793 additions and 73 deletions.
40 changes: 23 additions & 17 deletions Cargo.lock

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

11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main",
either = "1.9.0"
expectorate = "1.1.0"
fatfs = "0.3.6"
filetime = "0.2.22"
flate2 = "1.0.27"
flume = "0.11.0"
foreign-types = "0.3.2"
Expand Down Expand Up @@ -247,15 +248,15 @@ omicron-sled-agent = { path = "sled-agent" }
omicron-test-utils = { path = "test-utils" }
omicron-zone-package = "0.8.3"
oxide-client = { path = "clients/oxide-client" }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "98d33125413f01722947e322f82caf9d22209434", features = [ "api", "std" ] }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "631c2017f19cafb1535f621e9e5aa9198ccad869", features = [ "api", "std" ] }
once_cell = "1.18.0"
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
openapiv3 = "1.0"
# must match samael's crate!
openssl = "0.10"
openssl-sys = "0.9"
openssl-probe = "0.1.2"
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "98d33125413f01722947e322f82caf9d22209434" }
opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "631c2017f19cafb1535f621e9e5aa9198ccad869" }
oso = "0.26"
owo-colors = "3.5.0"
oximeter = { path = "oximeter/oximeter" }
Expand All @@ -279,9 +280,9 @@ pretty-hex = "0.3.0"
proc-macro2 = "1.0"
progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "42c878b71a58d430dfc306126af5d40ca816d70f" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "42c878b71a58d430dfc306126af5d40ca816d70f", features = [ "generated-migration" ] }
propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "42c878b71a58d430dfc306126af5d40ca816d70f", default-features = false, features = ["mock-only"] }
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "901b710b6e5bd05a94a323693c2b971e7e7b240e" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "901b710b6e5bd05a94a323693c2b971e7e7b240e", features = [ "generated-migration" ] }
propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "901b710b6e5bd05a94a323693c2b971e7e7b240e", default-features = false, features = ["mock-only"] }
proptest = "1.2.0"
quote = "1.0"
rand = "0.8.5"
Expand Down
16 changes: 15 additions & 1 deletion clients/gateway-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ progenitor::generate_api!(
}),
derives = [schemars::JsonSchema],
patch = {
SpIdentifier = { derives = [Copy, PartialEq, Hash, Eq, PartialOrd, Ord, Serialize, Deserialize] },
SpIdentifier = { derives = [Copy, PartialEq, Hash, Eq, Serialize, Deserialize] },
SpIgnition = { derives = [PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize] },
SpIgnitionSystemType = { derives = [Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize] },
SpState = { derives = [ PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize] },
Expand All @@ -59,3 +59,17 @@ progenitor::generate_api!(
HostPhase2RecoveryImageId = { derives = [ PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize] },
},
);

// Override the impl of Ord for SpIdentifier because the default one orders the
// fields in a different order than people are likely to want.
impl Ord for crate::types::SpIdentifier {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.type_.cmp(&other.type_).then(self.slot.cmp(&other.slot))
}
}

impl PartialOrd for crate::types::SpIdentifier {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}
2 changes: 1 addition & 1 deletion dev-tools/crdb-seed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ readme = "README.md"
[dependencies]
anyhow.workspace = true
dropshot.workspace = true
omicron-test-utils.workspace = true
omicron-test-utils = { workspace = true, features = ["seed-gen"] }
slog.workspace = true
tokio.workspace = true
omicron-workspace-hack.workspace = true
3 changes: 2 additions & 1 deletion dev-tools/crdb-seed/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
use anyhow::{Context, Result};
use dropshot::{test_util::LogContext, ConfigLogging, ConfigLoggingLevel};
use omicron_test_utils::dev::seed::{
ensure_seed_tarball_exists, should_invalidate_seed, CRDB_SEED_TAR_ENV,
ensure_seed_tarball_exists, should_invalidate_seed,
};
use omicron_test_utils::dev::CRDB_SEED_TAR_ENV;
use std::io::Write;

#[tokio::main]
Expand Down
5 changes: 4 additions & 1 deletion dev-tools/omdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ chrono.workspace = true
clap.workspace = true
diesel.workspace = true
dropshot.workspace = true
futures.workspace = true
gateway-client.workspace = true
gateway-messages.workspace = true
gateway-test-utils.workspace = true
humantime.workspace = true
internal-dns.workspace = true
futures.workspace = true
nexus-client.workspace = true
nexus-db-model.workspace = true
nexus-db-queries.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions dev-tools/omdb/src/bin/omdb/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use std::net::SocketAddr;
use std::net::SocketAddrV6;

mod db;
mod mgs;
mod nexus;
mod oximeter;
mod sled_agent;
Expand All @@ -57,6 +58,7 @@ async fn main() -> Result<(), anyhow::Error> {

match &args.command {
OmdbCommands::Db(db) => db.run_cmd(&args, &log).await,
OmdbCommands::Mgs(mgs) => mgs.run_cmd(&args, &log).await,
OmdbCommands::Nexus(nexus) => nexus.run_cmd(&args, &log).await,
OmdbCommands::Oximeter(oximeter) => oximeter.run_cmd(&log).await,
OmdbCommands::SledAgent(sled) => sled.run_cmd(&args, &log).await,
Expand Down Expand Up @@ -155,6 +157,8 @@ impl Omdb {
enum OmdbCommands {
/// Query the control plane database (CockroachDB)
Db(db::DbArgs),
/// Debug a specific Management Gateway Service instance
Mgs(mgs::MgsArgs),
/// Debug a specific Nexus instance
Nexus(nexus::NexusArgs),
/// Query oximeter collector state
Expand Down
Loading

0 comments on commit 27013e4

Please sign in to comment.