New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BREAKING CHANGE: Add mc rb command to remove empty bucket #2662
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2662 +/- ##
=========================================
- Coverage 9.76% 9.69% -0.07%
=========================================
Files 125 128 +3
Lines 9205 12106 +2901
=========================================
+ Hits 899 1174 +275
- Misses 8155 10782 +2627
+ Partials 151 150 -1
Continue to review full report at Codecov.
|
We should mention this as a breaking change... |
cmd/mirror-main.go
Outdated
@@ -232,8 +232,8 @@ func (mj *mirrorJob) doRemove(sURLs URLs) URLs { | |||
contentCh := make(chan *clientContent, 1) | |||
contentCh <- &clientContent{URL: *newClientURL(sURLs.TargetContent.URL.Path)} | |||
close(contentCh) | |||
|
|||
errorCh := clnt.Remove(false, contentCh) | |||
isRemoveBucket := true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Praveenrajmani , changed it so mirror will not remove buckets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: This might be something apart from this PR (w.r.t remove
log print discussions), I see the command mc rm --force minio/bucket
do say that the object is being removed. But it wont actually remove without --recursive
flag set. In such cases, we could perhaps fallback saying that they should use -r
flag.
For ref,
The intention here is bucket is never removed from To remove buckets explicitly only command is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and LGTM
@poornas after introducing rb command, do you expect that rm is still able to remove objects from different buckets at the same time ? |
@vadmeste, yes - both the commands below will remove objects from different buckets, except that mc rb will delete bucket in addition.
and
|
@poornas I see, but I also mean this: does it also need to traverse several buckets and remove all objects in them ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except some minor changes
363dcb2
to
cb22756
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes minio#2635 - Change mc rm --recursive behavior to delete objects in bucket but not the bucket itself.
Fixes #2635 - Change mc rm --recursive behavior to
delete objects in bucket but not the
bucket itself.