Skip to content

Commit

Permalink
add route stage to saga dag, fix destination property (#5062)
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow authored Feb 14, 2024
1 parent ca6301b commit a93462f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nexus/src/app/sagas/switch_port_settings_apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ declare_saga_actions! {
+ spa_ensure_switch_port_settings
- spa_undo_ensure_switch_port_settings
}
ENSURE_SWITCH_ROUTES -> "ensure_switch_routes" {
+ spa_ensure_switch_routes
- spa_undo_ensure_switch_routes
}
ENSURE_SWITCH_PORT_UPLINK -> "ensure_switch_port_uplink" {
+ spa_ensure_switch_port_uplink
- spa_undo_ensure_switch_port_uplink
}
ENSURE_SWITCH_ROUTES -> "ensure_switch_routes" {
+ spa_ensure_switch_routes
- spa_undo_ensure_switch_routes
}
ENSURE_SWITCH_PORT_BGP_SETTINGS -> "ensure_switch_port_bgp_settings" {
+ spa_ensure_switch_port_bgp_settings
- spa_undo_ensure_switch_port_bgp_settings
Expand Down Expand Up @@ -95,6 +95,7 @@ impl NexusSaga for SagaSwitchPortSettingsApply {
builder.append(get_switch_port_settings_action());
builder.append(ensure_switch_port_settings_action());
builder.append(ensure_switch_port_uplink_action());
builder.append(ensure_switch_routes_action());
builder.append(ensure_switch_port_bgp_settings_action());
builder.append(ensure_switch_port_bootstore_network_settings_action());
Ok(builder.build()?)
Expand Down Expand Up @@ -238,8 +239,8 @@ async fn spa_ensure_switch_routes(
IpAddr::V4(v4) => v4,
IpAddr::V6(_) => continue,
};
let prefix = match r.gw.ip() {
IpAddr::V4(v4) => Prefix4 { value: v4, length: r.gw.prefix() },
let prefix = match r.dst.ip() {
IpAddr::V4(v4) => Prefix4 { value: v4, length: r.dst.prefix() },
IpAddr::V6(_) => continue,
};
let sr = StaticRoute4 { nexthop, prefix };
Expand Down

0 comments on commit a93462f

Please sign in to comment.