diff options
author | Alex Auvolat <alex@adnab.me> | 2020-07-08 17:33:24 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-07-08 17:33:24 +0200 |
commit | 64a6eda0d2bb6aae6a6eef60032ab24ae3c37a88 (patch) | |
tree | 9e3501aba850af7b2e3453e3bba4b3afce007852 /src/api/s3_delete.rs | |
parent | 84bbbfaa7b670d6dd1501aeecc6c44251819d4ae (diff) | |
download | garage-64a6eda0d2bb6aae6a6eef60032ab24ae3c37a88.tar.gz garage-64a6eda0d2bb6aae6a6eef60032ab24ae3c37a88.zip |
Migrate S3 api to use new model
Diffstat (limited to 'src/api/s3_delete.rs')
-rw-r--r-- | src/api/s3_delete.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/api/s3_delete.rs b/src/api/s3_delete.rs index 949ad6a1..c5cd5970 100644 --- a/src/api/s3_delete.rs +++ b/src/api/s3_delete.rs @@ -29,7 +29,11 @@ async fn handle_delete_internal( }; let interesting_versions = object.versions().iter().filter(|v| { - v.data != ObjectVersionData::DeleteMarker && v.state != ObjectVersionState::Aborted + match v.state { + ObjectVersionState::Aborted => false, + ObjectVersionState::Complete(ObjectVersionData::DeleteMarker) => false, + _ => true, + } }); let mut must_delete = None; @@ -54,10 +58,7 @@ async fn handle_delete_internal( vec![ObjectVersion { uuid: version_uuid, timestamp: now_msec(), - mime_type: "application/x-delete-marker".into(), - size: 0, - state: ObjectVersionState::Complete, - data: ObjectVersionData::DeleteMarker, + state: ObjectVersionState::Complete(ObjectVersionData::DeleteMarker), }], ); |