diff --git a/src-tauri/src/commands/integrations.rs b/src-tauri/src/commands/integrations.rs index 95438976..9c4ecd06 100644 --- a/src-tauri/src/commands/integrations.rs +++ b/src-tauri/src/commands/integrations.rs @@ -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); diff --git a/src-tauri/src/commands/kube.rs b/src-tauri/src/commands/kube.rs index 0737be06..241c49a1 100644 --- a/src-tauri/src/commands/kube.rs +++ b/src-tauri/src/commands/kube.rs @@ -4064,7 +4064,6 @@ pub async fn subscribe_to_k8s_events( state: State<'_, AppState>, ) -> Result { 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 { let _app_state = state.inner(); - let _app_state = state.inner(); let rx = crate::kube::start_all_resources_watcher(_app_state, cluster_id) .await diff --git a/src-tauri/src/kube/watcher.rs b/src-tauri/src/kube/watcher.rs index 515dd7c2..0da0433a 100644 --- a/src-tauri/src/kube/watcher.rs +++ b/src-tauri/src/kube/watcher.rs @@ -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(()) } }