Skip to content

Commit

Permalink
Merge branch 'main' into txn-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Dec 1, 2023
2 parents 180c872 + 92aed1a commit 9ea030c
Show file tree
Hide file tree
Showing 160 changed files with 14,876 additions and 3,872 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hakari.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
toolchain: stable
- name: Install cargo-hakari
uses: taiki-e/install-action@f7c663c03b51ed0d93e9cec22a575d3f02175989 # v2
uses: taiki-e/install-action@21526ba3bb38834e625c185ae4f2f942f1fb8f27 # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
27 changes: 14 additions & 13 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion clients/nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl From<&omicron_common::api::internal::nexus::ProducerEndpoint>
address: s.address.to_string(),
base_route: s.base_route.clone(),
id: s.id,
kind: s.kind.map(Into::into),
kind: s.kind.into(),
interval: s.interval.into(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion clients/oximeter-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl From<&omicron_common::api::internal::nexus::ProducerEndpoint>
address: s.address.to_string(),
base_route: s.base_route.clone(),
id: s.id,
kind: s.kind.map(Into::into),
kind: s.kind.into(),
interval: s.interval.into(),
}
}
Expand Down
1 change: 1 addition & 0 deletions clients/sled-agent-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ progenitor.workspace = true
ipnetwork.workspace = true
regress.workspace = true
reqwest = { workspace = true, features = [ "json", "rustls-tls", "stream" ] }
schemars.workspace = true
serde.workspace = true
slog.workspace = true
sled-storage.workspace = true
Expand Down
26 changes: 1 addition & 25 deletions clients/sled-agent-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use async_trait::async_trait;
use std::convert::TryFrom;
use std::str::FromStr;
use uuid::Uuid;

progenitor::generate_api!(
spec = "../../openapi/sled-agent.json",
derives = [ schemars::JsonSchema ],
inner_type = slog::Logger,
pre_hook = (|log: &slog::Logger, request: &reqwest::Request| {
slog::debug!(log, "client request";
Expand Down Expand Up @@ -529,27 +529,3 @@ impl TestInterfaces for Client {
.expect("disk_finish_transition() failed unexpectedly");
}
}

impl From<sled_storage::dataset::DatasetKind> for types::DatasetKind {
fn from(k: sled_storage::dataset::DatasetKind) -> Self {
use sled_storage::dataset::DatasetKind::*;
match k {
CockroachDb => Self::CockroachDb,
Crucible => Self::Crucible,
Clickhouse => Self::Clickhouse,
ClickhouseKeeper => Self::ClickhouseKeeper,
ExternalDns => Self::ExternalDns,
InternalDns => Self::InternalDns,
}
}
}

impl From<sled_storage::dataset::DatasetName> for types::DatasetName {
fn from(n: sled_storage::dataset::DatasetName) -> Self {
Self {
pool_name: types::ZpoolName::from_str(&n.pool().to_string())
.unwrap(),
kind: n.dataset().clone().into(),
}
}
}
1 change: 1 addition & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ impl From<ByteCount> for i64 {
Debug,
Deserialize,
Eq,
Hash,
JsonSchema,
Ord,
PartialEq,
Expand Down
2 changes: 1 addition & 1 deletion common/src/api/internal/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct ProducerEndpoint {
/// A unique ID for this producer.
pub id: Uuid,
/// The kind of producer.
pub kind: Option<ProducerKind>,
pub kind: ProducerKind,
/// The IP address and port at which `oximeter` can collect metrics from the
/// producer.
pub address: SocketAddr,
Expand Down
8 changes: 6 additions & 2 deletions common/src/api/internal/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ pub struct PortConfigV1 {
pub uplink_port_fec: PortFec,
/// BGP peers on this port
pub bgp_peers: Vec<BgpPeerConfig>,
/// Whether or not to set autonegotiation
#[serde(default)]
pub autoneg: bool,
}

impl From<UplinkConfig> for PortConfigV1 {
Expand All @@ -155,6 +158,7 @@ impl From<UplinkConfig> for PortConfigV1 {
uplink_port_speed: value.uplink_port_speed,
uplink_port_fec: value.uplink_port_fec,
bgp_peers: vec![],
autoneg: false,
}
}
}
Expand Down Expand Up @@ -260,7 +264,7 @@ pub enum ExternalPortDiscovery {
}

/// Switchport Speed options
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)]
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum PortSpeed {
#[serde(alias = "0G")]
Expand All @@ -284,7 +288,7 @@ pub enum PortSpeed {
}

/// Switchport FEC options
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)]
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum PortFec {
Firecode,
Expand Down
1 change: 1 addition & 0 deletions common/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl From<Error> for crate::api::external::Error {
///
/// This structure is intended to help with serialization and deserialization
/// of configuration information to both M.2s.
#[derive(Debug)]
pub struct Ledger<T> {
log: Logger,
ledger: T,
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-model/src/producer_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub struct ProducerEndpoint {
#[diesel(embed)]
identity: ProducerEndpointIdentity,

pub kind: Option<ProducerKind>,
pub kind: ProducerKind,
pub ip: ipnetwork::IpNetwork,
pub port: SqlU16,
pub interval: f64,
Expand All @@ -69,7 +69,7 @@ impl ProducerEndpoint {
) -> Self {
Self {
identity: ProducerEndpointIdentity::new(endpoint.id),
kind: endpoint.kind.map(Into::into),
kind: endpoint.kind.into(),
ip: endpoint.address.ip().into(),
port: endpoint.address.port().into(),
base_route: endpoint.base_route.clone(),
Expand Down
5 changes: 3 additions & 2 deletions nexus/db-model/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ table! {
mtu -> Int4,
fec -> crate::SwitchLinkFecEnum,
speed -> crate::SwitchLinkSpeedEnum,
autoneg -> Bool,
}
}

Expand Down Expand Up @@ -399,7 +400,7 @@ table! {
id -> Uuid,
time_created -> Timestamptz,
time_modified -> Timestamptz,
kind -> Nullable<crate::ProducerKindEnum>,
kind -> crate::ProducerKindEnum,
ip -> Inet,
port -> Int4,
interval -> Float8,
Expand Down Expand Up @@ -1300,7 +1301,7 @@ table! {
///
/// This should be updated whenever the schema is changed. For more details,
/// refer to: schema/crdb/README.adoc
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(15, 0, 0);
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(17, 0, 0);

allow_tables_to_appear_in_same_query!(
system_update,
Expand Down
3 changes: 3 additions & 0 deletions nexus/db-model/src/switch_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ pub struct SwitchPortLinkConfig {
pub mtu: SqlU16,
pub fec: SwitchLinkFec,
pub speed: SwitchLinkSpeed,
pub autoneg: bool,
}

impl SwitchPortLinkConfig {
Expand All @@ -365,13 +366,15 @@ impl SwitchPortLinkConfig {
mtu: u16,
fec: SwitchLinkFec,
speed: SwitchLinkSpeed,
autoneg: bool,
) -> Self {
Self {
port_settings_id,
lldp_service_config_id,
link_name,
fec,
speed,
autoneg,
mtu: mtu.into(),
}
}
Expand Down
Loading

0 comments on commit 9ea030c

Please sign in to comment.