fix: use installation_device from host_config in bootstrap_okd_node #228
20
Cargo.lock
generated
20
Cargo.lock
generated
@@ -3638,6 +3638,26 @@ dependencies = [
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "json-prompt"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"brocade",
|
||||
"cidr",
|
||||
"env_logger",
|
||||
"harmony",
|
||||
"harmony_cli",
|
||||
"harmony_macros",
|
||||
"harmony_secret",
|
||||
"harmony_secret_derive",
|
||||
"harmony_types",
|
||||
"log",
|
||||
"schemars 0.8.22",
|
||||
"serde",
|
||||
"tokio",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jsonpath-rust"
|
||||
version = "0.7.5"
|
||||
|
||||
@@ -191,22 +191,29 @@ impl OKDNodeInterpret {
|
||||
);
|
||||
|
||||
let okd_role_properties = self.okd_role_properties(&self.host_role);
|
||||
// The iPXE script content is the same for all control plane nodes,
|
||||
// pointing to the 'master.ign' ignition file.
|
||||
|
||||
let http_ip = &topology.http_server.get_ip().to_string();
|
||||
let ignition_file_name = &okd_role_properties.ignition_file();
|
||||
|
||||
// Create and apply an iPXE boot file for each node.
|
||||
for (node, host_config) in nodes {
|
||||
let content = BootstrapIpxeTpl {
|
||||
http_ip: &topology.http_server.get_ip().to_string(),
|
||||
http_ip,
|
||||
scos_path: "scos",
|
||||
ignition_http_path: "okd_ignition_files",
|
||||
//TODO must be refactored to not only use /dev/sda
|
||||
installation_device: "/dev/sda", // This might need to be configurable per-host in the future
|
||||
ignition_file_name: okd_role_properties.ignition_file(),
|
||||
installation_device: host_config.installation_device.as_deref().ok_or_else(
|
||||
|| {
|
||||
InterpretError::new(format!(
|
||||
"Could not find an installation device for host {}",
|
||||
node.summary()
|
||||
))
|
||||
},
|
||||
)?,
|
||||
ignition_file_name,
|
||||
}
|
||||
.to_string();
|
||||
|
||||
debug!("[{}] iPXE content template:\n{content}", self.host_role);
|
||||
|
||||
// Create and apply an iPXE boot file for each node.
|
||||
for (node, _) in nodes {
|
||||
let mac_address = node.get_mac_address();
|
||||
if mac_address.is_empty() {
|
||||
return Err(InterpretError::new(format!(
|
||||
|
||||
Reference in New Issue
Block a user