Skip to content

[4/n] [sync-switch] replace db-model builder inputs with domain types#10645

Open
sunshowers wants to merge 3 commits into
sunshowers/spr/main.4n-sync-switch-replace-db-model-builder-inputs-with-domain-typesfrom
sunshowers/spr/4n-sync-switch-replace-db-model-builder-inputs-with-domain-types
Open

[4/n] [sync-switch] replace db-model builder inputs with domain types#10645
sunshowers wants to merge 3 commits into
sunshowers/spr/main.4n-sync-switch-replace-db-model-builder-inputs-with-domain-typesfrom
sunshowers/spr/4n-sync-switch-replace-db-model-builder-inputs-with-domain-types

Conversation

@sunshowers

@sunshowers sunshowers commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Follow a pattern similar to the reconfigurator. This allows nexus-switch-config to drop the dependency on nexus-db-model and nexus-db-queries.

Also add a test for a non-BGP port.

Depends on:

Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1

/// A port's TX-EQ overrides.
pub struct TxEqInput {
pub pre1: Option<i32>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't create these names, and they may even be domain specific. They do however make me want to iron the wrinkles out of my brain.

pub pre1: Option<i32>,
pub pre2: Option<i32>,
pub main: Option<i32>,
pub post2: Option<i32>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ordering of post2 before post1 intentional?

/// A port's LLDP settings.
pub struct LldpInput {
pub enabled: bool,
pub link_name: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know if these are all optional semantically? Again, I know this is a refactoring, I'm just wondering if we can clean this up later? Do you do that in future PRs?

@rcgoodfellow @internet-diglett

return None;
}
None => {
error!(log, "rack subnet not set"; "rack" => ?rack);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

use super::*;

#[test]
fn peerless_port_needs_no_switch_bgp_config() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, a test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants