Skip to content
Open
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
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions sled-agent/scrimlet-reconcilers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ workspace = true
chrono.workspace = true
daft.workspace = true
dpd-client.workspace = true
either.workspace = true
futures.workspace = true
gateway-client.workspace = true
gateway-types.workspace = true
Expand All @@ -19,6 +20,8 @@ macaddr.workspace = true
mg-admin-client.workspace = true
omicron-common.workspace = true
omicron-uuid-kinds.workspace = true
oxnet.workspace = true
rdb-types.workspace = true
reqwest.workspace = true
sled-agent-types.workspace = true
slog.workspace = true
Expand Down
1 change: 1 addition & 0 deletions sled-agent/scrimlet-reconcilers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub use handle::ScrimletReconcilers;
pub use handle::ScrimletReconcilersMode;
pub use handle::SledAgentNetworkingInfo;
pub use mgd_reconciler::MgdReconcilerStatus;
pub use mgd_reconciler::MgdStaticRouteReconcilerStatus;
pub use status::DetermineSwitchSlotStatus;
pub use status::ReconcilerActivationReason;
pub use status::ReconcilerCurrentStatus;
Expand Down
32 changes: 23 additions & 9 deletions sled-agent/scrimlet-reconcilers/src/mgd_reconciler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,31 @@ use sled_agent_types::system_networking::SystemNetworkingConfig;
use slog::Logger;
use std::time::Duration;

mod static_route_reconciler;

pub use static_route_reconciler::MgdStaticRouteReconcilerStatus;

#[derive(Debug, Clone)]
pub struct MgdReconcilerStatus {
pub todo_status: (),
pub static_routes_status: MgdStaticRouteReconcilerStatus,
}

impl slog::KV for MgdReconcilerStatus {
fn serialize(
&self,
_record: &slog::Record<'_>,
record: &slog::Record<'_>,
serializer: &mut dyn slog::Serializer,
) -> slog::Result {
serializer.emit_str("mgd-reconciler".into(), "not yet implemented")
let Self { static_routes_status } = self;
static_routes_status.serialize(record, serializer)?;
Ok(())
}
}

#[derive(Debug)]
pub(crate) struct MgdReconciler {
_client: Client,
_switch_slot: ThisSledSwitchSlot,
client: Client,
switch_slot: ThisSledSwitchSlot,
}

impl Reconciler for MgdReconciler {
Expand All @@ -45,14 +51,22 @@ impl Reconciler for MgdReconciler {
switch_slot: ThisSledSwitchSlot,
parent_log: &Logger,
) -> Self {
Self { _client: mode.mgd_client(parent_log), _switch_slot: switch_slot }
Self { client: mode.mgd_client(parent_log), switch_slot }
}

async fn do_reconciliation(
&mut self,
_system_networking_config: &SystemNetworkingConfig,
_log: &Logger,
system_networking_config: &SystemNetworkingConfig,
log: &Logger,
) -> Self::Status {
MgdReconcilerStatus { todo_status: () }
let static_routes_status = static_route_reconciler::reconcile(
&self.client,
&system_networking_config.rack_network_config,
self.switch_slot,
log,
)
.await;

MgdReconcilerStatus { static_routes_status }
}
}
Loading
Loading