File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments