fix: boostrap control plane was using non-existend get_control_plane_host function -> control_plane. Also fix okd installation example
Some checks failed
Run Check Script / check (pull_request) Failing after 21s

This commit is contained in:
Jean-Gabriel Gill-Couture 2025-09-04 17:54:33 -04:00
parent 902185daa4
commit f31d21f9da
2 changed files with 20 additions and 16 deletions

View File

@ -2,7 +2,11 @@ mod topology;
use crate::topology::{get_inventory, get_topology}; use crate::topology::{get_inventory, get_topology};
use harmony::{ 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; use harmony_secret::SecretManager;
@ -13,17 +17,17 @@ async fn main() {
let ssh_key = SecretManager::get_or_prompt::<SshKeyPair>().await.unwrap(); let ssh_key = SecretManager::get_or_prompt::<SshKeyPair>().await.unwrap();
let scores: Vec<Box<dyn Score<HAClusterTopology>>> = vec![ let mut scores: Vec<Box<dyn Score<HAClusterTopology>>> = vec![Box::new(OKDIpxeScore {
Box::new(OKDIpxeScore { kickstart_filename: "inventory.kickstart".to_string(),
kickstart_filename: "inventory.kickstart".to_string(), harmony_inventory_agent: "harmony_inventory_agent".to_string(),
harmony_inventory_agent: "harmony_inventory_agent".to_string(), cluster_pubkey: FileContent {
cluster_pubkey: FileContent { path: FilePath::Relative("cluster_ssh_key.pub".to_string()),
path: FilePath::Relative("cluster_ssh_key.pub".to_string()), content: ssh_key.public,
content: ssh_key.public, },
}, })];
}),
Box::new(OKDInstallationPipeline {}), scores.append(&mut OKDInstallationPipeline::get_all_scores().await);
];
harmony_cli::run(inventory, topology, scores, None) harmony_cli::run(inventory, topology, scores, None)
.await .await
.unwrap(); .unwrap();

View File

@ -105,23 +105,23 @@ impl OKDSetup03ControlPlaneInterpret {
info!("[ControlPlane] Configuring host bindings for control plane nodes."); info!("[ControlPlane] Configuring host bindings for control plane nodes.");
// Ensure the topology definition matches the number of physical nodes found. // 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!( return Err(InterpretError::new(format!(
"Mismatch between logical control plane hosts defined in topology ({}) and physical nodes found ({}).", "Mismatch between logical control plane hosts defined in topology ({}) and physical nodes found ({}).",
topology.control_plane_hosts.len(), topology.control_plane.len(),
nodes.len() nodes.len()
))); )));
} }
// Create a binding for each physical host to its corresponding logical host. // Create a binding for each physical host to its corresponding logical host.
let bindings: Vec<HostBinding> = topology let bindings: Vec<HostBinding> = topology
.control_plane_hosts .control_plane
.iter() .iter()
.zip(nodes.iter()) .zip(nodes.iter())
.map(|(logical_host, physical_host)| { .map(|(logical_host, physical_host)| {
info!( info!(
"Creating binding: Logical Host '{}' -> Physical Host ID '{}'", "Creating binding: Logical Host '{}' -> Physical Host ID '{}'",
logical_host.get_hostname(), logical_host.name,
physical_host.id physical_host.id
); );
HostBinding { HostBinding {