From 4ea3d7f69cf3d89fc3345e3c1d84abe0d21918ae Mon Sep 17 00:00:00 2001 From: Sylvain Tremblay Date: Wed, 28 Jan 2026 14:41:49 -0500 Subject: [PATCH 1/2] fix: support DiscoveryStrategy in OKDSetup01InventoryScore --- Cargo.lock | 16 ++++++++++++++++ harmony/src/modules/okd/bootstrap_01_prepare.rs | 11 ++++++++--- harmony/src/modules/okd/installation.rs | 4 +++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 98912dc4..2c444f85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1874,6 +1874,22 @@ dependencies = [ "url", ] +[[package]] +name = "example-nats-supercluster" +version = "0.1.0" +dependencies = [ + "cidr", + "env_logger", + "harmony", + "harmony_cli", + "harmony_macros", + "harmony_types", + "k8s-openapi", + "log", + "tokio", + "url", +] + [[package]] name = "example-ntfy" version = "0.1.0" diff --git a/harmony/src/modules/okd/bootstrap_01_prepare.rs b/harmony/src/modules/okd/bootstrap_01_prepare.rs index 988dcf63..329d5f4f 100644 --- a/harmony/src/modules/okd/bootstrap_01_prepare.rs +++ b/harmony/src/modules/okd/bootstrap_01_prepare.rs @@ -4,7 +4,7 @@ use crate::{ infra::inventory::InventoryRepositoryFactory, interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome}, inventory::{HostRole, Inventory}, - modules::inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy}, + modules::{inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy}, okd::bootstrap_okd_node::OKDNodeInterpret}, score::Score, topology::HAClusterTopology, }; @@ -21,11 +21,16 @@ use serde::Serialize; // ------------------------------------------------------------------------------------------------- #[derive(Debug, Clone, Serialize, new)] -pub struct OKDSetup01InventoryScore {} +pub struct OKDSetup01InventoryScore { + pub discovery_strategy: HarmonyDiscoveryStrategy, +} impl Score for OKDSetup01InventoryScore { fn create_interpret(&self) -> Box> { - Box::new(OKDSetup01InventoryInterpret::new(self.clone())) + Box::new(OKDNodeInterpret::new( + HostRole::Bootstrap, + self.discovery_strategy.clone(), + )) } fn name(&self) -> String { diff --git a/harmony/src/modules/okd/installation.rs b/harmony/src/modules/okd/installation.rs index dce24576..9b16788a 100644 --- a/harmony/src/modules/okd/installation.rs +++ b/harmony/src/modules/okd/installation.rs @@ -67,7 +67,9 @@ impl OKDInstallationPipeline { discovery_strategy: HarmonyDiscoveryStrategy, ) -> Vec>> { vec![ - Box::new(OKDSetup01InventoryScore::new()), + Box::new(OKDSetup01InventoryScore { + discovery_strategy: discovery_strategy.clone(), + }), Box::new(OKDSetup02BootstrapScore::new()), Box::new(OKDSetup03ControlPlaneScore { discovery_strategy: discovery_strategy.clone(), -- 2.39.5 From eebda0f4aafe92ef045593474d5cfc82e755eae0 Mon Sep 17 00:00:00 2001 From: Sylvain Tremblay Date: Wed, 28 Jan 2026 15:20:33 -0500 Subject: [PATCH 2/2] chore: format --- harmony/src/modules/okd/bootstrap_01_prepare.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/harmony/src/modules/okd/bootstrap_01_prepare.rs b/harmony/src/modules/okd/bootstrap_01_prepare.rs index 329d5f4f..6b24ccce 100644 --- a/harmony/src/modules/okd/bootstrap_01_prepare.rs +++ b/harmony/src/modules/okd/bootstrap_01_prepare.rs @@ -4,7 +4,10 @@ use crate::{ infra::inventory::InventoryRepositoryFactory, interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome}, inventory::{HostRole, Inventory}, - modules::{inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy}, okd::bootstrap_okd_node::OKDNodeInterpret}, + modules::{ + inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy}, + okd::bootstrap_okd_node::OKDNodeInterpret, + }, score::Score, topology::HAClusterTopology, }; -- 2.39.5