Skip to content

Commit

Permalink
Ready?
Browse files Browse the repository at this point in the history
Created using spr 1.3.5
  • Loading branch information
sunshowers committed Jan 17, 2024
2 parents 790cb96 + 213d5cc commit 51c64a9
Show file tree
Hide file tree
Showing 50 changed files with 678 additions and 2,582 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@681c09da0e1063a389bc0f4cfa913bfdfdaf0a4d # v2
uses: taiki-e/install-action@4f8e32492b3baed061f7836e6a4d40eb19e49b71 # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: Swatinem/rust-cache@a22603398250b864f7190077025cf752307154dc # v2.7.2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
if: ${{ github.ref != 'refs/heads/main' }}
- name: Report cargo version
run: cargo --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-openapi-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }} # see omicron#4461
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '18'
- name: Install our tools
Expand Down
67 changes: 21 additions & 46 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ percent-encoding = "2.3.1"
pem = "3.0"
petgraph = "0.6.4"
postgres-protocol = "0.6.6"
predicates = "3.0.4"
predicates = "3.1.0"
pretty_assertions = "1.4.0"
pretty-hex = "0.4.1"
prettyplease = "0.2.16"
Expand All @@ -305,8 +305,8 @@ quote = "1.0"
rand = "0.8.5"
ratatui = "0.23.0"
rayon = "1.8"
rcgen = "0.11.3"
reedline = "0.22.0"
rcgen = "0.12.0"
reedline = "0.28.0"
ref-cast = "1.0"
regex = "1.10.2"
regress = "0.7.1"
Expand Down Expand Up @@ -385,7 +385,7 @@ trust-dns-client = "0.22"
trust-dns-proto = "0.22"
trust-dns-resolver = "0.22"
trust-dns-server = "0.22"
trybuild = "1.0.88"
trybuild = "1.0.89"
tufaceous = { path = "tufaceous" }
tufaceous-lib = { path = "tufaceous-lib" }
unicode-width = "0.1.11"
Expand Down
26 changes: 0 additions & 26 deletions clients/nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,32 +241,6 @@ impl From<omicron_common::api::external::SemverVersion>
}
}

impl From<omicron_common::api::internal::nexus::KnownArtifactKind>
for types::KnownArtifactKind
{
fn from(
s: omicron_common::api::internal::nexus::KnownArtifactKind,
) -> Self {
use omicron_common::api::internal::nexus::KnownArtifactKind;

match s {
KnownArtifactKind::GimletSp => types::KnownArtifactKind::GimletSp,
KnownArtifactKind::GimletRot => types::KnownArtifactKind::GimletRot,
KnownArtifactKind::Host => types::KnownArtifactKind::Host,
KnownArtifactKind::Trampoline => {
types::KnownArtifactKind::Trampoline
}
KnownArtifactKind::ControlPlane => {
types::KnownArtifactKind::ControlPlane
}
KnownArtifactKind::PscSp => types::KnownArtifactKind::PscSp,
KnownArtifactKind::PscRot => types::KnownArtifactKind::PscRot,
KnownArtifactKind::SwitchSp => types::KnownArtifactKind::SwitchSp,
KnownArtifactKind::SwitchRot => types::KnownArtifactKind::SwitchRot,
}
}
}

impl From<std::time::Duration> for types::Duration {
fn from(s: std::time::Duration) -> Self {
Self { secs: s.as_secs(), nanos: s.subsec_nanos() }
Expand Down
1 change: 0 additions & 1 deletion clients/sled-agent-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ reqwest = { workspace = true, features = [ "json", "rustls-tls", "stream" ] }
schemars.workspace = true
serde.workspace = true
slog.workspace = true
sled-storage.workspace = true
uuid.workspace = true
omicron-workspace-hack.workspace = true
21 changes: 18 additions & 3 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2628,7 +2628,7 @@ pub struct BgpImportedRouteIpv4 {
}

/// A description of an uploaded TUF repository.
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
pub struct TufRepoDescription {
// Information about the repository.
pub repo: TufRepoMeta,
Expand All @@ -2637,10 +2637,17 @@ pub struct TufRepoDescription {
pub artifacts: Vec<TufArtifactMeta>,
}

impl TufRepoDescription {
/// Sorts the artifacts so that descriptions can be compared.
pub fn sort_artifacts(&mut self) {
self.artifacts.sort_by(|a, b| a.id.cmp(&b.id));
}
}

/// Metadata about a TUF repository.
///
/// Found within a [`TufRepoDescription`].
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
pub struct TufRepoMeta {
/// The hash of the repository.
///
Expand Down Expand Up @@ -2669,7 +2676,7 @@ pub struct TufRepoMeta {
/// Metadata about an individual TUF artifact.
///
/// Found within a [`TufRepoDescription`].
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize, JsonSchema)]
pub struct TufArtifactMeta {
/// The artifact ID.
pub id: ArtifactId,
Expand Down Expand Up @@ -2707,6 +2714,14 @@ pub enum TufRepoInsertStatus {
Inserted,
}

/// Data about a successful TUF repo get from Nexus.
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub struct TufRepoGetResponse {
/// The description of the repository.
pub description: TufRepoDescription,
}

#[cfg(test)]
mod test {
use serde::Deserialize;
Expand Down
4 changes: 0 additions & 4 deletions common/src/nexus_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,6 @@ pub struct ConsoleConfig {
pub struct UpdatesConfig {
/// Trusted root.json role for the TUF updates repository.
pub trusted_root: PathBuf,
/// Default base URL for the TUF repository.
pub default_base_url: String,
}

/// Options to tweak database schema changes.
Expand Down Expand Up @@ -638,7 +636,6 @@ mod test {
address = "[::1]:8123"
[updates]
trusted_root = "/path/to/root.json"
default_base_url = "http://example.invalid/"
[tunables]
max_vpc_ipv4_subnet_prefix = 27
[deployment]
Expand Down Expand Up @@ -735,7 +732,6 @@ mod test {
},
updates: Some(UpdatesConfig {
trusted_root: PathBuf::from("/path/to/root.json"),
default_base_url: "http://example.invalid/".into(),
}),
schema: None,
tunables: Tunables { max_vpc_ipv4_subnet_prefix: 27 },
Expand Down
Loading

0 comments on commit 51c64a9

Please sign in to comment.