diff --git a/src/main.rs b/src/main.rs index 3f1960a..1e74609 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,7 +37,7 @@ fn setup_logger() -> Result<(), log::SetLoggerError> { }) .level(if cfg!(debug_assertions) { // TODO: Add a flag to enable debug logging - log::LevelFilter::Info + log::LevelFilter::Debug } else { log::LevelFilter::Debug }) diff --git a/src/routes/delete_database.rs b/src/routes/delete_database.rs index 69d6c3e..d52b84a 100644 --- a/src/routes/delete_database.rs +++ b/src/routes/delete_database.rs @@ -38,9 +38,19 @@ async fn delete_database( .as_str(), ), //.labels(format!("app.kubernetes.io/managed-by=Moonscale").as_str() ) - .await?; + .await; - for item in list.items { + if list.is_err() { + warn!( + "Failed to list resources while deleting instance {} ({}/{})", + instance, + ar.kind, + list.err().unwrap() + ); + continue; + } + + for item in list.unwrap().items { let name = item.name_any(); let ns = item.metadata.namespace.map(|s| s + "/").unwrap_or_default();