Use directories.new when getting S3 directory
What does this MR do?
Same as https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/6682:
Calling Fog::Storage::AWS::Directories#get
requires the ListAllMyBuckets
permission, but we can avoid that extra query and permission by
initializing the directory with a specific bucket:
https://stackoverflow.com/a/12288581/1992201
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/5807
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Kamil Trzciński