Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion end-to-end-tests/src/instance_launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ async fn instance_launch() -> Result<()> {
}),
disks: Vec::new(),
network_interfaces: InstanceNetworkInterfaceAttachment::Default,
external_ips: vec![ExternalIpCreate::Ephemeral { pool: None }],
external_ips: vec![ExternalIpCreate::Ephemeral {
pool: None,
ip_version: None,
}],
user_data: String::new(),
ssh_public_keys: Some(vec![oxide_client::types::NameOrId::Name(
ssh_key_name.clone(),
Expand Down
20 changes: 20 additions & 0 deletions nexus/db-model/src/ip_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ impl_enum_type!(
serde::Deserialize,
Eq,
FromSqlRow,
Hash,
schemars::JsonSchema,
PartialEq,
serde::Serialize,
Expand Down Expand Up @@ -289,13 +290,32 @@ impl std::fmt::Display for IpPoolType {
}
}

/// IP pool resource type.
///
/// `pool_type` and `ip_version` are denormalized from [IpPool]
/// for a unique index on defaults.
#[derive(Queryable, Insertable, Selectable, Clone, Copy, Debug, PartialEq)]
#[diesel(table_name = ip_pool_resource)]
pub struct IpPoolResource {
pub ip_pool_id: Uuid,
pub resource_type: IpPoolResourceType,
pub resource_id: Uuid,
pub is_default: bool,
pub pool_type: IpPoolType,
pub ip_version: IpVersion,
}

/// Input for creating an IP pool resource.
///
/// The `pool_type` and `ip_version` fields are populated from [IpPool]
/// by the `link_ip_pool_to_external_silo_query` query, so they are not needed
/// as input.
#[derive(Clone, Copy, Debug)]
pub struct IncompleteIpPoolResource {
pub ip_pool_id: Uuid,
pub resource_type: IpPoolResourceType,
pub resource_id: Uuid,
pub is_default: bool,
}

impl From<IpPoolResource> for views::IpPoolSiloLink {
Expand Down
3 changes: 2 additions & 1 deletion nexus/db-model/src/schema_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{collections::BTreeMap, sync::LazyLock};
///
/// This must be updated when you change the database schema. Refer to
/// schema/crdb/README.adoc in the root of this repository for details.
pub const SCHEMA_VERSION: Version = Version::new(216, 0, 0);
pub const SCHEMA_VERSION: Version = Version::new(217, 0, 0);

/// List of all past database schema versions, in *reverse* order
///
Expand All @@ -28,6 +28,7 @@ static KNOWN_VERSIONS: LazyLock<Vec<KnownVersion>> = LazyLock::new(|| {
// | leaving the first copy as an example for the next person.
// v
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
KnownVersion::new(217, "multiple-default-ip-pools-per-silo"),
KnownVersion::new(216, "add-trust-quorum"),
KnownVersion::new(215, "support-up-to-12-disks"),
KnownVersion::new(214, "separate-transit-ips-by-version"),
Expand Down
Loading
Loading