From 07bef6432c9914b1898abd48a1fa7fc73c0c9674 Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Tue, 13 Feb 2024 23:26:37 -0800 Subject: [PATCH] add route stage to saga dag, fix destination property --- nexus/src/app/sagas/switch_port_settings_apply.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nexus/src/app/sagas/switch_port_settings_apply.rs b/nexus/src/app/sagas/switch_port_settings_apply.rs index 9d0573f6b0..9e2331f416 100644 --- a/nexus/src/app/sagas/switch_port_settings_apply.rs +++ b/nexus/src/app/sagas/switch_port_settings_apply.rs @@ -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 @@ -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()?) @@ -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 };