Skip to content

Commit 8ea8c7c

Browse files
author
LorenzoTettamanti
committed
[#94]: added uninstall command in CLI (beta)
1 parent c088958 commit 8ea8c7c

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

cli/src/uninstall.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
use std::process::Command;
2+
use std::io::stdin;
3+
4+
pub fn uninstall() {
5+
println!("Uninstalling cortexflow...");
6+
let mut userinput: String = String::new();
7+
println!("Select one option");
8+
display_uninstall_options();
9+
stdin().read_line(&mut userinput).expect("Error reading user input");
10+
11+
if userinput == "1" {
12+
println!("Deleting cortexflow components");
13+
14+
Command::new("kubectl")
15+
.args(["delete", "namespace", "cortexflow"])
16+
.output()
17+
.expect("Error deleting cortexflow namespace");
18+
} else if userinput == "2" {
19+
println!("Deleting cortexflow-identity service");
20+
21+
Command::new("kubectl")
22+
.args(["delete", "daemonset", "cortexflow-identity"])
23+
.output()
24+
.expect("Error deleting cortexflow-identity");
25+
}
26+
}
27+
fn display_uninstall_options() {
28+
println!("1 > all");
29+
println!("2 > identity-service");
30+
}

0 commit comments

Comments
 (0)