fix(kubernetes): remove redundant TS cast and fix cargo fmt failures
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m28s
Test / frontend-typecheck (pull_request) Successful in 1m36s
PR Review Automation / review (pull_request) Successful in 4m1s
Test / rust-fmt-check (pull_request) Successful in 10m59s
Test / rust-clippy (pull_request) Successful in 12m49s
Test / rust-tests (pull_request) Successful in 14m17s

- Remove redundant `as Set<ResourceType>` cast in kubernetesStore initial
  state; the generic parameter already constrains the type
- Reformat watcher.rs vec! literal and Watcher::new call to satisfy
  rustfmt line-length rules (CI was failing cargo fmt --check)
This commit is contained in:
Shaun Arman 2026-06-07 11:37:17 -05:00
parent 8753a05a04
commit 468a69d89e
2 changed files with 10 additions and 3 deletions

View File

@ -72,7 +72,13 @@ pub async fn start_all_resources_watcher(
) -> Result<mpsc::Receiver<serde_json::Value>> { ) -> Result<mpsc::Receiver<serde_json::Value>> {
let (tx, rx) = mpsc::channel(100); let (tx, rx) = mpsc::channel(100);
let resources = vec!["pods", "services", "deployments", "replicasets", "daemonsets"]; let resources = vec![
"pods",
"services",
"deployments",
"replicasets",
"daemonsets",
];
for resource_type in resources { for resource_type in resources {
let watcher_tx = tx.clone(); let watcher_tx = tx.clone();
@ -80,7 +86,8 @@ pub async fn start_all_resources_watcher(
let namespace = "default".to_string(); let namespace = "default".to_string();
tokio::spawn(async move { tokio::spawn(async move {
let watcher = Watcher::new(cluster_id, namespace, resource_type.to_string(), watcher_tx); let watcher =
Watcher::new(cluster_id, namespace, resource_type.to_string(), watcher_tx);
if let Err(e) = watcher.start().await { if let Err(e) = watcher.start().await {
tracing::error!("Watcher for {} failed: {}", resource_type, e); tracing::error!("Watcher for {} failed: {}", resource_type, e);
} }

View File

@ -87,7 +87,7 @@ export const useKubernetesStore = create<KubernetesState>()((set, get) => ({
namespaces: {}, namespaces: {},
// Loaded resources tracking // Loaded resources tracking
loadedResources: new Set<ResourceType>() as Set<ResourceType>, loadedResources: new Set<ResourceType>(),
// Terminal sessions // Terminal sessions
terminalSessions: {}, terminalSessions: {},