Skip to content

Commit

Permalink
Handle bundle cleanup from deleted zpool
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Dec 16, 2024
1 parent 5cc668e commit 51be611
Show file tree
Hide file tree
Showing 2 changed files with 275 additions and 115 deletions.
10 changes: 9 additions & 1 deletion nexus/db-queries/src/db/datastore/zpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,15 @@ impl DataStore {
.select(dsl::sled_id)
.first_async::<Uuid>(&*conn)
.await
.map_err(|e| public_error_from_diesel(e, ErrorHandler::Server))?;
.map_err(|e| {
public_error_from_diesel(
e,
ErrorHandler::NotFoundByLookup(
ResourceType::Zpool,
LookupType::by_id(id.into_untyped_uuid()),
),
)
})?;

Ok(SledUuid::from_untyped_uuid(id))
}
Expand Down
Loading

0 comments on commit 51be611

Please sign in to comment.