fix: added example use case, fixed exec app command to use &&

This commit is contained in:
Willem 2025-08-25 16:03:31 -04:00
parent 3867d436ad
commit 3567d0f420
5 changed files with 40 additions and 13 deletions

19
Cargo.lock generated
View File

@ -1700,16 +1700,6 @@ dependencies = [
"url",
]
[[package]]
name = "example_remove_rook_osd"
version = "0.1.0"
dependencies = [
"harmony",
"harmony_cli",
"harmony_tui",
"tokio",
]
[[package]]
name = "eyre"
version = "0.6.12"
@ -4265,6 +4255,15 @@ version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "remove_rook_osd"
version = "0.1.0"
dependencies = [
"harmony",
"harmony_cli",
"tokio",
]
[[package]]
name = "reqwest"
version = "0.11.27"

View File

@ -0,0 +1,11 @@
[package]
name = "example-remove-rook-osd"
edition = "2024"
version.workspace = true
readme.workspace = true
license.workspace = true
[dependencies]
harmony = { version = "0.1.0", path = "../../harmony" }
harmony_cli = { version = "0.1.0", path = "../../harmony_cli" }
tokio.workspace = true

View File

@ -0,0 +1,18 @@
use harmony::{
inventory::Inventory, modules::storage::ceph::ceph_remove_osd_score::CephRemoveOsd,
topology::K8sAnywhereTopology,
};
#[tokio::main]
async fn main() {
let ceph_score = CephRemoveOsd {
osd_deployment_name: "rook-ceph-osd-2".to_string(),
rook_ceph_namespace: "rook-ceph".to_string(),
};
let topology = K8sAnywhereTopology::from_env();
let inventory = Inventory::autoload();
harmony_cli::run(inventory, topology, vec![Box::new(ceph_score)], None)
.await
.unwrap();
}

View File

@ -293,8 +293,7 @@ impl CephRemoveOsdInterpret {
vec![
"sh",
"-c",
format!("ceph osd purge {osd_id_numeric} --yes-i-really-mean-it").as_str(),
format!("ceph auth del {osd_id_full}").as_str(),
format!("ceph osd purge {osd_id_numeric} --yes-i-really-mean-it && ceph auth del {osd_id_full}").as_str(),
],
)
.await?;

View File

@ -1 +1 @@
pub mod ceph_osd_replacement_score;
pub mod ceph_remove_osd_score;