Skip to content

Commit

Permalink
back out switch-specific config for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Nieuwejaar committed Jul 2, 2024
1 parent d65056a commit f98e238
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 535 deletions.
25 changes: 1 addition & 24 deletions common/src/api/internal/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ pub struct RackNetworkConfigV2 {
/// BFD configuration for connecting the rack to external networks
#[serde(default)]
pub bfd: Vec<BfdPeerConfig>,
/// Rack-level LLDP settings
pub lldp: Option<LldpSwitchConfig>,
}

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)]
Expand Down Expand Up @@ -374,27 +372,6 @@ impl FromStr for UplinkAddressConfig {
}
}

/// Per-switch LLDP configuration settings.
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, JsonSchema)]
pub struct LldpSwitchConfig {
/// Switch being configured
pub switch: SwitchLocation,
/// Chassis ID to advertise. If this is set, it will be advertised as a
/// LocallyAssigned ID type. If this is not set, it will default to
/// the serial number of the attached scrimlet. (XXX: This doesn't seem
/// great. We really want to identify the rack and switch in a way that
/// will be useful to the admin.)
pub chassis_id: Option<String>,
/// System name to advertise. If not set, it will default to the serial
/// number of the attached scrimlet.
pub system_name: Option<String>,
/// System description to advertise. If not set, it will include the model
/// number of the scrimlet and revision of the sidecar.
pub system_description: Option<String>,
/// Management addresses to advertise.
pub management_addrs: Vec<IpAddr>,
}

#[derive(
Clone, Debug, Default, Deserialize, Serialize, PartialEq, Eq, JsonSchema,
)]
Expand Down Expand Up @@ -495,7 +472,7 @@ pub struct PortConfigV2 {
#[serde(default)]
pub autoneg: bool,
/// LLDP configuration for this port
pub lldp_port: Option<LldpPortConfig>,
pub lldp: Option<LldpPortConfig>,
}

/// A set of switch uplinks.
Expand Down
3 changes: 1 addition & 2 deletions nexus/src/app/background/sync_switch_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ impl BackgroundTask for SwitchPortSettingsManager {
.map(|l| l.speed)
.unwrap_or(SwitchLinkSpeed::Speed100G)
.into(),
lldp_port: None,
lldp: None,
};

for peer in port_config.bgp_peers.iter_mut() {
Expand Down Expand Up @@ -1111,7 +1111,6 @@ impl BackgroundTask for SwitchPortSettingsManager {
ports,
bgp,
bfd,
lldp: None
}),
},
};
Expand Down
1 change: 0 additions & 1 deletion nexus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ impl nexus_test_interface::NexusServer for Server {
ports: Vec::new(),
bgp: Vec::new(),
bfd: Vec::new(),
lldp: None,
},
allowed_source_ips: AllowedSourceIps::Any,
},
Expand Down
2 changes: 0 additions & 2 deletions nexus/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,8 +949,6 @@ impl<'a, N: NexusServer> ControlPlaneTestContextBuilder<'a, N> {
rack_subnet: "fd00:1122:3344:0100::/56"
.parse()
.unwrap(),
// XXX: fill this in
lldp: None,
}),
},
generation: 1,
Expand Down
52 changes: 1 addition & 51 deletions openapi/bootstrap-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,47 +785,6 @@
"status"
]
},
"LldpSwitchConfig": {
"description": "Per-switch LLDP configuration settings.",
"type": "object",
"properties": {
"chassis_id": {
"nullable": true,
"description": "Chassis ID to advertise. If this is set, it will be advertised as a LocallyAssigned ID type. If this is not set, it will default to the serial number of the attached scrimlet. (XXX: This doesn't seem great. We really want to identify the rack and switch in a way that will be useful to the admin.)",
"type": "string"
},
"management_addrs": {
"description": "Management addresses to advertise.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"switch": {
"description": "Switch being configured",
"allOf": [
{
"$ref": "#/components/schemas/SwitchLocation"
}
]
},
"system_description": {
"nullable": true,
"description": "System description to advertise. If not set, it will include the model number of the scrimlet and revision of the sidecar.",
"type": "string"
},
"system_name": {
"nullable": true,
"description": "System name to advertise. If not set, it will default to the serial number of the attached scrimlet.",
"type": "string"
}
},
"required": [
"management_addrs",
"switch"
]
},
"Name": {
"title": "A name unique within the parent collection",
"description": "Names must begin with a lower case ASCII letter, be composed exclusively of lowercase ASCII, uppercase ASCII, numbers, and '-', and may not end with a '-'. Names cannot be a UUID though they may contain a UUID.",
Expand Down Expand Up @@ -861,7 +820,7 @@
"$ref": "#/components/schemas/BgpPeerConfig"
}
},
"lldp_port": {
"lldp": {
"nullable": true,
"description": "LLDP configuration for this port",
"allOf": [
Expand Down Expand Up @@ -1074,15 +1033,6 @@
"type": "string",
"format": "ipv4"
},
"lldp": {
"nullable": true,
"description": "Rack-level LLDP settings",
"allOf": [
{
"$ref": "#/components/schemas/LldpSwitchConfig"
}
]
},
"ports": {
"description": "Uplinks for connecting the rack to external networks",
"type": "array",
Expand Down
52 changes: 1 addition & 51 deletions openapi/nexus-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -3486,47 +3486,6 @@
"status"
]
},
"LldpSwitchConfig": {
"description": "Per-switch LLDP configuration settings.",
"type": "object",
"properties": {
"chassis_id": {
"nullable": true,
"description": "Chassis ID to advertise. If this is set, it will be advertised as a LocallyAssigned ID type. If this is not set, it will default to the serial number of the attached scrimlet. (XXX: This doesn't seem great. We really want to identify the rack and switch in a way that will be useful to the admin.)",
"type": "string"
},
"management_addrs": {
"description": "Management addresses to advertise.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"switch": {
"description": "Switch being configured",
"allOf": [
{
"$ref": "#/components/schemas/SwitchLocation"
}
]
},
"system_description": {
"nullable": true,
"description": "System description to advertise. If not set, it will include the model number of the scrimlet and revision of the sidecar.",
"type": "string"
},
"system_name": {
"nullable": true,
"description": "System name to advertise. If not set, it will default to the serial number of the attached scrimlet.",
"type": "string"
}
},
"required": [
"management_addrs",
"switch"
]
},
"MacAddr": {
"example": "ff:ff:ff:ff:ff:ff",
"title": "A MAC address",
Expand Down Expand Up @@ -3936,7 +3895,7 @@
"$ref": "#/components/schemas/BgpPeerConfig"
}
},
"lldp_port": {
"lldp": {
"nullable": true,
"description": "LLDP configuration for this port",
"allOf": [
Expand Down Expand Up @@ -4311,15 +4270,6 @@
"type": "string",
"format": "ipv4"
},
"lldp": {
"nullable": true,
"description": "Rack-level LLDP settings",
"allOf": [
{
"$ref": "#/components/schemas/LldpSwitchConfig"
}
]
},
"ports": {
"description": "Uplinks for connecting the rack to external networks",
"type": "array",
Expand Down
52 changes: 1 addition & 51 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -3462,47 +3462,6 @@
"status"
]
},
"LldpSwitchConfig": {
"description": "Per-switch LLDP configuration settings.",
"type": "object",
"properties": {
"chassis_id": {
"nullable": true,
"description": "Chassis ID to advertise. If this is set, it will be advertised as a LocallyAssigned ID type. If this is not set, it will default to the serial number of the attached scrimlet. (XXX: This doesn't seem great. We really want to identify the rack and switch in a way that will be useful to the admin.)",
"type": "string"
},
"management_addrs": {
"description": "Management addresses to advertise.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"switch": {
"description": "Switch being configured",
"allOf": [
{
"$ref": "#/components/schemas/SwitchLocation"
}
]
},
"system_description": {
"nullable": true,
"description": "System description to advertise. If not set, it will include the model number of the scrimlet and revision of the sidecar.",
"type": "string"
},
"system_name": {
"nullable": true,
"description": "System name to advertise. If not set, it will default to the serial number of the attached scrimlet.",
"type": "string"
}
},
"required": [
"management_addrs",
"switch"
]
},
"MacAddr": {
"example": "ff:ff:ff:ff:ff:ff",
"title": "A MAC address",
Expand Down Expand Up @@ -4184,7 +4143,7 @@
"$ref": "#/components/schemas/BgpPeerConfig"
}
},
"lldp_port": {
"lldp": {
"nullable": true,
"description": "LLDP configuration for this port",
"allOf": [
Expand Down Expand Up @@ -4320,15 +4279,6 @@
"type": "string",
"format": "ipv4"
},
"lldp": {
"nullable": true,
"description": "Rack-level LLDP settings",
"allOf": [
{
"$ref": "#/components/schemas/LldpSwitchConfig"
}
]
},
"ports": {
"description": "Uplinks for connecting the rack to external networks",
"type": "array",
Expand Down
50 changes: 1 addition & 49 deletions openapi/wicketd.json
Original file line number Diff line number Diff line change
Expand Up @@ -5264,38 +5264,6 @@
"$ref": "#/components/schemas/IpNet"
}
},
"UserSpecifiedLldpSwitchConfig": {
"description": "User-specified version of [`LldpSwitchConfig`].\n\nAll of [`LldpSwitchConfig`] is user-specified. But we expect the switch ID be a key, rather than a field as in [`LldpSwitchConfig`]. So this has all of the fields other than the port name.\n\n[`LldpSwitchConfig`]: omicron_common::api::internal::shared::LldpSwitchConfig",
"type": "object",
"properties": {
"chassis_id": {
"nullable": true,
"description": "Chassis ID to advertise. If this is set, it will be advertised as a LocallyAssigned ID type. If this is not set, it will default to the serial number of the attached scrimlet. (XXX: This doesn't seem great. We really want to identify the rack and switch in a way that will be useful to the admin.)",
"type": "string"
},
"management_addrs": {
"description": "Management addresses to advertise.",
"type": "array",
"items": {
"type": "string",
"format": "ip"
}
},
"system_description": {
"nullable": true,
"description": "System description to advertise. If not set, it will include the model number of the scrimlet and revision of the sidecar.",
"type": "string"
},
"system_name": {
"nullable": true,
"description": "System name to advertise. If not set, it will default to the serial number of the attached scrimlet.",
"type": "string"
}
},
"required": [
"management_addrs"
]
},
"UserSpecifiedPortConfig": {
"description": "User-specified version of [`PortConfigV2`].\n\nAll of [`PortConfigV2`] is user-specified. But we expect the port name to be a key, rather than a field as in [`PortConfigV2`]. So this has all of the fields other than the port name.\n\n[`PortConfigV2`]: omicron_common::api::internal::shared::PortConfigV2",
"type": "object",
Expand All @@ -5316,7 +5284,7 @@
"$ref": "#/components/schemas/UserSpecifiedBgpPeerConfig"
}
},
"lldp_port": {
"lldp": {
"nullable": true,
"allOf": [
{
Expand Down Expand Up @@ -5370,27 +5338,11 @@
"$ref": "#/components/schemas/UserSpecifiedPortConfig"
}
},
"switch0_lldp": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/UserSpecifiedLldpSwitchConfig"
}
]
},
"switch1": {
"type": "object",
"additionalProperties": {
"$ref": "#/components/schemas/UserSpecifiedPortConfig"
}
},
"switch1_lldp": {
"nullable": true,
"allOf": [
{
"$ref": "#/components/schemas/UserSpecifiedLldpSwitchConfig"
}
]
}
},
"required": [
Expand Down
Loading

0 comments on commit f98e238

Please sign in to comment.