Skip to content

Commit

Permalink
Attempt to use update_and_check
Browse files Browse the repository at this point in the history
Created using spr 1.3.5
  • Loading branch information
sunshowers committed Nov 28, 2023
2 parents 96260aa + 55b3953 commit ec940be
Show file tree
Hide file tree
Showing 45 changed files with 1,530 additions and 438 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@8f354f35e51028c902e8ab954045e37739acf562 # v2
uses: taiki-e/install-action@c1dd9c9e59427252db32b9ece987f4eebc3a021a # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
40 changes: 25 additions & 15 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 @@ -160,7 +160,7 @@ byteorder = "1.5.0"
bytes = "1.5.0"
bytesize = "1.3.0"
camino = "1.1"
camino-tempfile = "1.0.2"
camino-tempfile = "1.1.1"
cancel-safe-futures = "0.1.5"
chacha20poly1305 = "0.10.1"
ciborium = "0.2.1"
Expand Down Expand Up @@ -282,7 +282,7 @@ p256 = "0.13"
parse-display = "0.8.2"
partial-io = { version = "0.5.4", features = ["proptest1", "tokio1"] }
paste = "1.0.14"
percent-encoding = "2.3.0"
percent-encoding = "2.3.1"
pem = "1.1"
petgraph = "0.6.4"
postgres-protocol = "0.6.6"
Expand Down
2 changes: 1 addition & 1 deletion bootstore/src/schemes/v0/request_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl RequestManager {
let expiry = now + self.config.rack_init_timeout;
let mut acks = InitAcks::default();
acks.expected =
packages.keys().cloned().filter(|id| id != &self.id).collect();
packages.keys().filter(|&id| id != &self.id).cloned().collect();
let req = TrackableRequest::InitRack {
rack_uuid,
packages: packages.clone(),
Expand Down
2 changes: 1 addition & 1 deletion common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ impl SemverVersion {
/// This is the official ECMAScript-compatible validation regex for
/// semver:
/// <https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string>
const VALIDATION_REGEX: &str = r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$";
const VALIDATION_REGEX: &'static str = r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$";
}

impl JsonSchema for SemverVersion {
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omicron-dev/tests/test_omicron_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use subprocess::Redirection;
const CMD_OMICRON_DEV: &str = env!("CARGO_BIN_EXE_omicron-dev");

/// timeout used for various things that should be pretty quick
const TIMEOUT: Duration = Duration::from_secs(15);
const TIMEOUT: Duration = Duration::from_secs(30);

fn path_to_omicron_dev() -> PathBuf {
path_to_executable(CMD_OMICRON_DEV)
Expand Down
5 changes: 3 additions & 2 deletions illumos-utils/src/running_zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ mod zenter {
// the contracts used for this come from templates that define becoming
// empty as a critical event.
pub fn contract_reaper(log: Logger) {
const EVENT_PATH: &[u8] = b"/system/contract/process/pbundle";
const EVENT_PATH: &'static [u8] = b"/system/contract/process/pbundle";
const CT_PR_EV_EMPTY: u64 = 1;

let cpath = CString::new(EVENT_PATH).unwrap();
Expand Down Expand Up @@ -327,7 +327,8 @@ mod zenter {
}

impl Template {
const TEMPLATE_PATH: &[u8] = b"/system/contract/process/template\0";
const TEMPLATE_PATH: &'static [u8] =
b"/system/contract/process/template\0";

// Constants related to how the contract below is managed. See
// `usr/src/uts/common/sys/contract/process.h` in the illumos sources
Expand Down
2 changes: 2 additions & 0 deletions nexus/db-model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ mod sled_instance;
mod sled_provision_state;
mod sled_resource;
mod sled_resource_kind;
mod sled_underlay_subnet_allocation;
mod snapshot;
mod ssh_key;
mod switch;
Expand Down Expand Up @@ -155,6 +156,7 @@ pub use sled_instance::*;
pub use sled_provision_state::*;
pub use sled_resource::*;
pub use sled_resource_kind::*;
pub use sled_underlay_subnet_allocation::*;
pub use snapshot::*;
pub use ssh_key::*;
pub use switch::*;
Expand Down
19 changes: 1 addition & 18 deletions nexus/db-model/src/rack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

use crate::schema::rack;
use db_macros::Asset;
use ipnetwork::{IpNetwork, Ipv6Network};
use ipnetwork::IpNetwork;
use nexus_types::{external_api::views, identity::Asset};
use omicron_common::api;
use uuid::Uuid;

/// Information about a local rack.
Expand All @@ -29,22 +28,6 @@ impl Rack {
rack_subnet: None,
}
}

pub fn subnet(&self) -> Result<Ipv6Network, api::external::Error> {
match self.rack_subnet {
Some(IpNetwork::V6(subnet)) => Ok(subnet),
Some(IpNetwork::V4(_)) => {
return Err(api::external::Error::InternalError {
internal_message: "rack subnet not IPv6".into(),
})
}
None => {
return Err(api::external::Error::InternalError {
internal_message: "rack subnet not set".into(),
})
}
}
}
}

impl From<Rack> for views::Rack {
Expand Down
12 changes: 11 additions & 1 deletion nexus/db-model/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,16 @@ table! {
}
}

table! {
sled_underlay_subnet_allocation (rack_id, sled_id) {
rack_id -> Uuid,
sled_id -> Uuid,
subnet_octet -> Int2,
hw_baseboard_id -> Uuid,
}
}
allow_tables_to_appear_in_same_query!(rack, sled_underlay_subnet_allocation);

table! {
switch (id) {
id -> Uuid,
Expand Down Expand Up @@ -1290,7 +1300,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(13, 0, 0);
pub const SCHEMA_VERSION: SemverVersion = SemverVersion::new(14, 0, 0);

allow_tables_to_appear_in_same_query!(
system_update,
Expand Down
4 changes: 2 additions & 2 deletions nexus/db-model/src/sled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::schema::{physical_disk, service, sled, zpool};
use crate::{ipv6, SledProvisionState};
use chrono::{DateTime, Utc};
use db_macros::Asset;
use nexus_types::{external_api::views, identity::Asset};
use nexus_types::{external_api::shared, external_api::views, identity::Asset};
use std::net::Ipv6Addr;
use std::net::SocketAddrV6;
use uuid::Uuid;
Expand Down Expand Up @@ -94,7 +94,7 @@ impl From<Sled> for views::Sled {
Self {
identity: sled.identity(),
rack_id: sled.rack_id,
baseboard: views::Baseboard {
baseboard: shared::Baseboard {
serial: sled.serial_number,
part: sled.part_number,
revision: sled.revision,
Expand Down
16 changes: 16 additions & 0 deletions nexus/db-model/src/sled_underlay_subnet_allocation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

use crate::schema::sled_underlay_subnet_allocation;
use uuid::Uuid;

/// Underlay allocation for a sled added to an initialized rack
#[derive(Queryable, Insertable, Debug, Clone, Selectable)]
#[diesel(table_name = sled_underlay_subnet_allocation)]
pub struct SledUnderlaySubnetAllocation {
pub rack_id: Uuid,
pub sled_id: Uuid,
pub subnet_octet: i16,
pub hw_baseboard_id: Uuid,
}
4 changes: 2 additions & 2 deletions nexus/db-model/src/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::Generation;
use crate::schema::switch;
use chrono::{DateTime, Utc};
use db_macros::Asset;
use nexus_types::{external_api::views, identity::Asset};
use nexus_types::{external_api::shared, external_api::views, identity::Asset};
use uuid::Uuid;

/// Baseboard information about a switch.
Expand Down Expand Up @@ -57,7 +57,7 @@ impl From<Switch> for views::Switch {
Self {
identity: switch.identity(),
rack_id: switch.rack_id,
baseboard: views::Baseboard {
baseboard: shared::Baseboard {
serial: switch.serial_number,
part: switch.part_number,
revision: switch.revision,
Expand Down
Loading

0 comments on commit ec940be

Please sign in to comment.