[#31] Add force bucket delete flag #436
No reviewers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#436
Loading…
Reference in a new issue
No description provided.
Delete branch "pogpp/frostfs-s3-gw:feature/31-full_bucket_removal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Pavel Pogodaev p.pogodaev@yadro.com
@ -240,0 +240,4 @@
skipObjCheck := false
if value, ok := r.Header[api.AmzForceBucketDelete]; !ok {
h.logAndSendError(w, "missing X-Amz-Force-Delete-Bucket", reqInfo, errors.GetAPIError(errors.ErrMissingForceBucketDeleteHeader))
return
This is compatibility-breaking change. We should not fail in case of missing this header.
@ -794,3 +794,3 @@
}
func (n *Layer) DeleteBucket(ctx context.Context, p *DeleteBucketParams) error {
func (n *Layer) DeleteBucket(ctx context.Context, p *DeleteBucketParams, skipCheck bool) error {
Why not put
skipcheck
in aDeleteBucketParams
? Looks quite suitable for this setting.93f871cd1f
to18cc091545
18cc091545
to95dfa4657a
95dfa4657a
to8e61b055da
@ -813,3 +814,3 @@
return err
}
if len(res) != 0 {
if len(res) != 0 && !p.SkipCheck {
I appreciate small changes, it looks very nice and clean.
However, I am not sure it is worth keeping
n.getAllObjectVersions
when we can skip it entirely ifSkipCheck == true
.Also it would be nice to have tests for this new behavior
@ -0,0 +34,4 @@
```text
DELETE / HTTP/1.1
Host: data.s3.<Region>.frostfs-s3-gw.com
There should be
X-Amz-Force-Delete-Bucket: true
header as well.WIP: [#31] Add force bucket delete flagto [#31] Add force bucket delete flag[#31] Add force bucket delete flagto [#31] Add force bucket delete flag8e61b055da
to9c0b781193
9c0b781193
to51c5c227c2
Looks great!
@ -517,6 +535,13 @@ func deleteObjectsBase(hc *handlerContext, bktName string, objVersions [][2]stri
return w
}
func deleteBucketForce(t *testing.T, tc *handlerContext, bktName string, code int, value string) {
Minor (non-blocking): it's better to write