fix: support DiscoveryStrategy in OKDSetup01InventoryScore #224
@@ -4,7 +4,10 @@ use crate::{
|
|||||||
infra::inventory::InventoryRepositoryFactory,
|
infra::inventory::InventoryRepositoryFactory,
|
||||||
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
interpret::{Interpret, InterpretError, InterpretName, InterpretStatus, Outcome},
|
||||||
inventory::{HostRole, Inventory},
|
inventory::{HostRole, Inventory},
|
||||||
modules::inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy},
|
modules::{
|
||||||
|
inventory::{DiscoverHostForRoleScore, HarmonyDiscoveryStrategy},
|
||||||
|
okd::bootstrap_okd_node::OKDNodeInterpret,
|
||||||
|
},
|
||||||
score::Score,
|
score::Score,
|
||||||
topology::HAClusterTopology,
|
topology::HAClusterTopology,
|
||||||
};
|
};
|
||||||
@@ -21,11 +24,16 @@ use serde::Serialize;
|
|||||||
// -------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, new)]
|
#[derive(Debug, Clone, Serialize, new)]
|
||||||
pub struct OKDSetup01InventoryScore {}
|
pub struct OKDSetup01InventoryScore {
|
||||||
|
pub discovery_strategy: HarmonyDiscoveryStrategy,
|
||||||
|
}
|
||||||
|
|
||||||
impl Score<HAClusterTopology> for OKDSetup01InventoryScore {
|
impl Score<HAClusterTopology> for OKDSetup01InventoryScore {
|
||||||
fn create_interpret(&self) -> Box<dyn Interpret<HAClusterTopology>> {
|
fn create_interpret(&self) -> Box<dyn Interpret<HAClusterTopology>> {
|
||||||
Box::new(OKDSetup01InventoryInterpret::new(self.clone()))
|
Box::new(OKDNodeInterpret::new(
|
||||||
|
HostRole::Bootstrap,
|
||||||
|
self.discovery_strategy.clone(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn name(&self) -> String {
|
fn name(&self) -> String {
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ impl OKDInstallationPipeline {
|
|||||||
discovery_strategy: HarmonyDiscoveryStrategy,
|
discovery_strategy: HarmonyDiscoveryStrategy,
|
||||||
) -> Vec<Box<dyn Score<HAClusterTopology>>> {
|
) -> Vec<Box<dyn Score<HAClusterTopology>>> {
|
||||||
vec![
|
vec![
|
||||||
Box::new(OKDSetup01InventoryScore::new()),
|
Box::new(OKDSetup01InventoryScore {
|
||||||
|
discovery_strategy: discovery_strategy.clone(),
|
||||||
|
}),
|
||||||
Box::new(OKDSetup02BootstrapScore::new()),
|
Box::new(OKDSetup02BootstrapScore::new()),
|
||||||
Box::new(OKDSetup03ControlPlaneScore {
|
Box::new(OKDSetup03ControlPlaneScore {
|
||||||
discovery_strategy: discovery_strategy.clone(),
|
discovery_strategy: discovery_strategy.clone(),
|
||||||
|
|||||||
Reference in New Issue
Block a user