fix: Use ssh key from FileContent in OKDIpxe score instead of hardcoded path
Some checks failed
Run Check Script / check (pull_request) Failing after 28s

This commit is contained in:
2025-09-03 13:07:00 -04:00
parent b765e9b7dc
commit 680902e450
4 changed files with 26 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ use harmony::{
okd::{
bootstrap_dhcp::OKDBootstrapDhcpScore,
bootstrap_load_balancer::OKDBootstrapLoadBalancerScore, dhcp::OKDDhcpScore,
dns::OKDDnsScore, ipxe::OkdIpxeScore,
dns::OKDDnsScore, ipxe::OKDIpxeScore,
},
tftp::TftpScore,
},
@@ -136,10 +136,10 @@ async fn main() {
let cluster_pubkey_filename = "cluster_ssh_key.pub".to_string();
let harmony_inventory_agent = "harmony_inventory_agent".to_string();
let ipxe_score = OkdIpxeScore {
let ipxe_score = OKDIpxeScore {
kickstart_filename,
harmony_inventory_agent,
cluster_pubkey_filename,
cluster_pubkey,
};
harmony_tui::run(

View File

@@ -2,21 +2,25 @@ mod topology;
use crate::topology::{get_inventory, get_topology};
use harmony::{
modules::okd::{installation::OKDInstallationScore, ipxe::OkdIpxeScore},
score::Score,
topology::HAClusterTopology,
config::secret::SshKeyPair, data::{FileContent, FilePath}, modules::okd::{installation::OKDInstallationScore, ipxe::OKDIpxeScore}, score::Score, topology::HAClusterTopology
};
use harmony_secret::SecretManager;
#[tokio::main]
async fn main() {
let inventory = get_inventory();
let topology = get_topology().await;
let ssh_key = SecretManager::get_or_prompt::<SshKeyPair>().await.unwrap();
let scores: Vec<Box<dyn Score<HAClusterTopology>>> = vec![
Box::new(OkdIpxeScore {
Box::new(OKDIpxeScore {
kickstart_filename: "inventory.kickstart".to_string(),
harmony_inventory_agent: "cluster_ssh_key.pub".to_string(),
cluster_pubkey_filename: "harmony_inventory_agent".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(OKDInstallationScore {}),
];

View File

@@ -1,7 +1,7 @@
mod topology;
use crate::topology::{get_inventory, get_topology};
use harmony::modules::okd::ipxe::OkdIpxeScore;
use harmony::modules::okd::ipxe::OKDIpxeScore;
#[tokio::main]
async fn main() {
@@ -12,10 +12,10 @@ async fn main() {
let cluster_pubkey_filename = "cluster_ssh_key.pub".to_string();
let harmony_inventory_agent = "harmony_inventory_agent".to_string();
let ipxe_score = OkdIpxeScore {
let ipxe_score = OKDIpxeScore {
kickstart_filename,
harmony_inventory_agent,
cluster_pubkey_filename,
cluster_pubkey,
};
harmony_cli::run(inventory, topology, vec![Box::new(ipxe_score)], None)