Skip to content
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

share: Presign objects under a dir prefix #2215

Merged
merged 2 commits into from
Jul 31, 2017
Merged

Conversation

vadmeste
Copy link
Member

From now on, when the user specifies to share a prefix which represents
a directory, all objects under that directory will be shared without
having to check for --recursive flag. If the latter is specified, all
objects in all subdirs will be shared.

Fixed #2204

@codecov-io
Copy link

codecov-io commented Jul 14, 2017

Codecov Report

Merging #2215 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2215      +/-   ##
=========================================
- Coverage    8.88%   8.87%   -0.01%     
=========================================
  Files          93      93              
  Lines        9028    9033       +5     
=========================================
  Hits          802     802              
- Misses       8099    8104       +5     
  Partials      127     127
Impacted Files Coverage Δ
cmd/share-download-main.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d066ff7...5304ce3. Read the comment docs.

@krisis
Copy link
Member

krisis commented Jul 17, 2017

@vadmeste, I have the following namespace,

➜  mc git:(r2215) mc ls -r s1/test
[2017-07-17 09:46:21 IST]   105B dir/obj1
[2017-07-17 09:46:21 IST]   105B dir/obj2
[2017-07-17 09:46:21 IST]   105B dir/obj3
[2017-07-17 09:46:21 IST]   105B dir/obj4
[2017-07-17 09:43:58 IST]   105B obj1
[2017-07-17 09:43:58 IST]   105B obj2
[2017-07-17 09:43:58 IST]   105B obj3
[2017-07-17 09:43:58 IST]   105B obj4

When I run mc share download s1/test/dir I don't see shared URLs of the objects under the prefix.
But when I run mc share download s1/test/dir/ I see share URLs of all the objects under the prefix.
This may be due to how we treat alias+path in mc, but this seems a little odd to me from a usability point of view. If we decide to stick to the current implementation we need to update mc-share's usage message.
I.e,

OPTIONS:
  --recursive, -r                  Share all objects recursively.

and

  4. Share all objects under this folder and all its sub-folders with 5 days expiry.
      $ mc share download --recursive --expire=120h s3/backup/

@vadmeste
Copy link
Member Author

@krisis, I fixed the issue now. Thanks

Copy link
Member

@krisis krisis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vadmeste The help message still needs to be changed.

@vadmeste
Copy link
Member Author

@vadmeste The help message still needs to be changed.

There is nothing to update @krisis. --recursive will share all objects under the specified directory and its subdirs. Without --recursive, only objects directly located under the specified dir will be shared.

From now on, when the user specifies to share a prefix which represents
a directory, all objects under that directory will be shared without
having to check for --recursive flag. If the latter is specified, all
objects in all subdirs will be shared.
@vadmeste
Copy link
Member Author

@krisis, help text updated. Please take a look again.

@deekoder deekoder merged commit b62fa40 into minio:master Jul 31, 2017
@vadmeste vadmeste deleted the issue/2204 branch May 29, 2018 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'share download endpoint/bucket/' without -r does not produce share links
5 participants