feat(kubernetes): implement Phase 7 - Real-time updates with Lens Desktop v5.x feature parity (v2) #76

Merged
sarman merged 7 commits from feature/kubernetes-management-v2 into master 2026-06-07 16:52:13 +00:00
3 changed files with 16 additions and 13 deletions
Showing only changes of commit 8753a05a04 - Show all commits

View File

@ -326,6 +326,10 @@ pub async fn initiate_oauth(
let integration_webviews = app_state.integration_webviews.clone();
let mcp_connections = app_state.mcp_connections.clone();
let pending_approvals = app_state.pending_approvals.clone();
let clusters = app_state.clusters.clone();
let port_forwards = app_state.port_forwards.clone();
let refresh_registry = app_state.refresh_registry.clone();
let watchers = app_state.watchers.clone();
tokio::spawn(async move {
let app_state_for_callback = AppState {
@ -335,12 +339,10 @@ pub async fn initiate_oauth(
integration_webviews,
mcp_connections,
pending_approvals,
clusters: Arc::new(tokio::sync::Mutex::new(std::collections::HashMap::new())),
port_forwards: Arc::new(tokio::sync::Mutex::new(std::collections::HashMap::new())),
refresh_registry: Arc::new(tokio::sync::Mutex::new(
crate::kube::RefreshRegistry::new(),
)),
watchers: Arc::new(Mutex::new(std::collections::HashMap::new())),
clusters,
port_forwards,
refresh_registry,
watchers,
};
while let Some(callback) = callback_rx.recv().await {
tracing::info!("Received OAuth callback for state: {}", callback.state);

View File

@ -4064,7 +4064,6 @@ pub async fn subscribe_to_k8s_events(
state: State<'_, AppState>,
) -> Result<String, String> {
let _app_state = state.inner();
let _app_state = state.inner();
let rx = crate::kube::start_resource_watcher(_app_state, cluster_id, namespace, resource_type)
.await
@ -4091,7 +4090,6 @@ pub async fn subscribe_to_all_k8s_events(
state: State<'_, AppState>,
) -> Result<String, String> {
let _app_state = state.inner();
let _app_state = state.inner();
let rx = crate::kube::start_all_resources_watcher(_app_state, cluster_id)
.await

View File

@ -32,11 +32,14 @@ impl Watcher {
self.resource_type, self.cluster_id, self.namespace
);
// Placeholder for watcher implementation
// Requires k8s-openapi with watch feature and tokio-stream
loop {
tokio::time::sleep(tokio::time::Duration::from_secs(60)).await;
}
// TODO: implement real watch stream via k8s-openapi + tokio-stream
tracing::warn!(
resource_type = %self.resource_type,
cluster_id = %self.cluster_id,
namespace = %self.namespace,
"Watcher is a stub — no events will be emitted until k8s watch stream is implemented"
);
Ok(())
}
}