diff --git a/examples/okd_installation/src/main.rs b/examples/okd_installation/src/main.rs index e474e0a..e581d5d 100644 --- a/examples/okd_installation/src/main.rs +++ b/examples/okd_installation/src/main.rs @@ -2,7 +2,11 @@ mod topology; use crate::topology::{get_inventory, get_topology}; use harmony::{ - config::secret::SshKeyPair, data::{FileContent, FilePath}, modules::okd::{installation::OKDInstallationPipeline, ipxe::OKDIpxeScore}, score::Score, topology::HAClusterTopology + config::secret::SshKeyPair, + data::{FileContent, FilePath}, + modules::okd::{installation::OKDInstallationPipeline, ipxe::OKDIpxeScore}, + score::Score, + topology::HAClusterTopology, }; use harmony_secret::SecretManager; @@ -13,17 +17,17 @@ async fn main() { let ssh_key = SecretManager::get_or_prompt::().await.unwrap(); - let scores: Vec>> = vec![ - Box::new(OKDIpxeScore { - kickstart_filename: "inventory.kickstart".to_string(), - harmony_inventory_agent: "harmony_inventory_agent".to_string(), - cluster_pubkey: FileContent { - path: FilePath::Relative("cluster_ssh_key.pub".to_string()), - content: ssh_key.public, - }, - }), - Box::new(OKDInstallationPipeline {}), - ]; + let mut scores: Vec>> = vec![Box::new(OKDIpxeScore { + kickstart_filename: "inventory.kickstart".to_string(), + harmony_inventory_agent: "harmony_inventory_agent".to_string(), + cluster_pubkey: FileContent { + path: FilePath::Relative("cluster_ssh_key.pub".to_string()), + content: ssh_key.public, + }, + })]; + + scores.append(&mut OKDInstallationPipeline::get_all_scores().await); + harmony_cli::run(inventory, topology, scores, None) .await .unwrap(); diff --git a/harmony/src/modules/okd/bootstrap_03_control_plane.rs b/harmony/src/modules/okd/bootstrap_03_control_plane.rs index 412a71a..bc5ab6f 100644 --- a/harmony/src/modules/okd/bootstrap_03_control_plane.rs +++ b/harmony/src/modules/okd/bootstrap_03_control_plane.rs @@ -105,23 +105,23 @@ impl OKDSetup03ControlPlaneInterpret { info!("[ControlPlane] Configuring host bindings for control plane nodes."); // Ensure the topology definition matches the number of physical nodes found. - if topology.control_plane_hosts.len() != nodes.len() { + if topology.control_plane.len() != nodes.len() { return Err(InterpretError::new(format!( "Mismatch between logical control plane hosts defined in topology ({}) and physical nodes found ({}).", - topology.control_plane_hosts.len(), + topology.control_plane.len(), nodes.len() ))); } // Create a binding for each physical host to its corresponding logical host. let bindings: Vec = topology - .control_plane_hosts + .control_plane .iter() .zip(nodes.iter()) .map(|(logical_host, physical_host)| { info!( "Creating binding: Logical Host '{}' -> Physical Host ID '{}'", - logical_host.get_hostname(), + logical_host.name, physical_host.id ); HostBinding {