Skip to content

Commit

Permalink
fix: only remove pod resource if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sagojez committed Jan 24, 2025
1 parent 9465dd0 commit 22b3a75
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions integrationos-api/src/logic/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,11 +641,14 @@ pub async fn delete_connection(
)
.await?;

if let ConnectionType::DatabaseSql { .. } = connection.args.r#type {
let service_name = ServiceName::from_id(connection.args.id)?;
let namespace = state.config.namespace.clone();
state.k8s_client.delete_all(namespace, service_name).await?;
};
match connection.args.r#type {
ConnectionType::DatabaseSql { .. } if connection.args.record_metadata.active => {
let service_name = ServiceName::from_id(connection.args.id)?;
let namespace = state.config.namespace.clone();
state.k8s_client.delete_all(namespace, service_name).await?;
}
_ => (),
}

let partial_cursor_key = format!("{}::{}::{}", access.ownership.id, id, connection.args.key);

Expand Down

0 comments on commit 22b3a75

Please sign in to comment.