-
Notifications
You must be signed in to change notification settings - Fork 285
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
bucketExists: Use a bool to indicate if a bucket exists or not #666
Conversation
06ecfb7
to
a50aef3
Compare
a50aef3
to
42da800
Compare
b001e4d
to
9c4d234
Compare
@ebozduman, I checked with |
Good point. |
1e74d4f
to
242072a
Compare
@ebozduman this PR is updated without following redirection. I think MovedPermanently status code is enough to indicate that a bucket exists. |
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.
@vadmeste can you confirm that it works as expected with AWS-S3 bucket in non us-east-1 location
@krishnasrinivas, yeah it is already tested with AWS with non standard location, AWS returns 301 status code (permanently moved) and the code considers it as the bucket exists and doesn't return any error. |
@vadmeste I think it is better to be consistent on the request styles (virtual vs path) unless there is a strong reason so that the request styles are predictable. Also some S3 servers don't support path style requests (reason by minio-go now supports A better fix for this would be change the API of bucketExists like how @dcharbonnier has suggested here #648 So bucketExists will be called like This will fix it:
|
oups, I didn't know that. Actually I was following "aws s3api head-bucket" command but also your suggestion seems to be fine and easier than the aws way. Will do it. |
242072a
to
56c21cb
Compare
56c21cb
to
4ef681a
Compare
@krishnasrinivas @ebozduman, updated the PR. But this is a breaking change, is @abperiasamy okay with that ? |
my 2 cents, if there is a plan to break compatibility maybe it would be time to start a 5.x milestone with more changes |
@vadmeste yes this change is correct. Previous API was implemented by me which was incorrect. Can you increment major version as well? |
This is a breaking API change. bucketExists API will require a callback with this signature cb(err, bool). This is a better way to indicate whether a bucket exists or not. Major version is also incremented.
4ef681a
to
653c14b
Compare
@krishnasrinivas, done, I set '5.0.0' in package.json. |
Latest version( |
Hm. Just seen that it is going to be in |
And docs already say it returns boolean - https://docs.minio.io/docs/javascript-client-api-reference#bucketExists |
@ruslan-polutsygan sorry about that :-( we will make a release soon. |
This is a breaking API change. bucketExists API will require
a callback with this signature cb(err, bool). This is a better
way to indicate whether a bucket exists or not.
Fixes #648