Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 2 additions & 10 deletions nexus/db-model/src/bgp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub struct BgpPeerView {
pub idle_hold_time: SqlU32,
pub keepalive: SqlU32,
pub remote_asn: Option<SqlU32>,
pub min_ttl: Option<SqlU32>,
pub min_ttl: Option<SqlU8>,
pub md5_auth_key: Option<String>,
pub multi_exit_discriminator: Option<SqlU32>,
pub local_pref: Option<SqlU32>,
Expand All @@ -172,8 +172,6 @@ pub struct BgpPeerView {
pub enum BgpPeerConfigDataError {
#[error("database contains illegal router lifetime value")]
RouterLifetime(#[source] RouterLifetimeConfigError),
#[error("database contains illegal min_ttl value: {0}")]
MinTtl(u32),
}

impl TryFrom<BgpPeerView> for BgpPeerConfig {
Expand All @@ -191,13 +189,7 @@ impl TryFrom<BgpPeerView> for BgpPeerConfig {
let router_lifetime =
RouterLifetimeConfig::new(value.router_lifetime.0)
.map_err(BgpPeerConfigDataError::RouterLifetime)?;
let min_ttl = value
.min_ttl
.map(|val| {
u8::try_from(*val)
.map_err(|_| BgpPeerConfigDataError::MinTtl(*val))
})
.transpose()?;
let min_ttl = value.min_ttl.map(|val| val.0);

Ok(Self {
asn: *value.asn,
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-schema/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ table! {
idle_hold_time -> Int8,
keepalive -> Int8,
remote_asn -> Nullable<Int8>,
min_ttl -> Nullable<Int8>,
min_ttl -> Nullable<Int2>,
md5_auth_key -> Nullable<Text>,
multi_exit_discriminator -> Nullable<Int8>,
local_pref -> Nullable<Int8>,
Expand Down
1 change: 0 additions & 1 deletion nexus/db-schema/tests/output/schema_known_drift.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
bfd_session.mode
bgp_peer_view.min_ttl
external_subnet.first_address
external_subnet.last_address
internet_gateway_ip_address.address
Expand Down
Loading