feat(kube): Implement complete kubectl port-forward runtime #72
@ -694,3 +694,19 @@ mod tests {
|
|||||||
assert!(validate_resource_name(&long_name, "pod").is_err());
|
assert!(validate_resource_name(&long_name, "pod").is_err());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub async fn shutdown_port_forwards(state: State<'_, AppState>) -> Result<(), String> {
|
||||||
|
let mut port_forwards = state.port_forwards.lock().await;
|
||||||
|
|
||||||
|
// Close all active port forward sessions
|
||||||
|
let session_ids: Vec<String> = port_forwards.keys().cloned().collect();
|
||||||
|
|
||||||
|
for session_id in session_ids {
|
||||||
|
if let Some(mut session) = port_forwards.remove(&session_id) {
|
||||||
|
session.close().await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|||||||
@ -182,6 +182,7 @@ pub fn run() {
|
|||||||
commands::kube::stop_port_forward,
|
commands::kube::stop_port_forward,
|
||||||
commands::kube::list_port_forwards,
|
commands::kube::list_port_forwards,
|
||||||
commands::kube::delete_port_forward,
|
commands::kube::delete_port_forward,
|
||||||
|
commands::kube::shutdown_port_forwards,
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("Error running Troubleshooting and RCA Assistant application");
|
.expect("Error running Troubleshooting and RCA Assistant application");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user