Skip to content

Commit

Permalink
fix(s3): don't delete bucket (#4430)
Browse files Browse the repository at this point in the history
* remove_all: don't delete `/`

* s3: don't delete bucket

* also check that the root is "/"

If the root is not "/" this wouldn't delete the bucket
  • Loading branch information
sameer authored Apr 11, 2024
1 parent 060960c commit 50b85fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/services/s3/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,11 @@ impl Accessor for S3Backend {
}

async fn delete(&self, path: &str, _: OpDelete) -> Result<RpDelete> {
// This would delete the bucket, do not perform
if self.core.root == "/" && path == "/" {
return Ok(RpDelete::default());
}

let resp = self.core.s3_delete_object(path).await?;

let status = resp.status();
Expand Down

0 comments on commit 50b85fb

Please sign in to comment.