summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-12-21 12:16:15 +0100
committerJan Provaznik <jprovaznik@gitlab.com>2018-12-27 11:06:06 +0100
commit2bfc317492f0a5918c4861203f3eedf71b2627aa (patch)
tree852793689891b2d9e08922bfe6a8c9b6f874eb2f /lib
parente242c8cd6b32f405c5734f9c3a61c48e746c30f1 (diff)
downloadgitlab-ce-2bfc317492f0a5918c4861203f3eedf71b2627aa.tar.gz
Use directories.new when getting S3 directory
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
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/cleanup/remote_uploads.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/cleanup/remote_uploads.rb b/lib/gitlab/cleanup/remote_uploads.rb
index eba1faacc3a..03298d960a4 100644
--- a/lib/gitlab/cleanup/remote_uploads.rb
+++ b/lib/gitlab/cleanup/remote_uploads.rb
@@ -67,7 +67,7 @@ module Gitlab
end
def remote_directory
- connection.directories.get(configuration['remote_directory'])
+ connection.directories.new(key: configuration['remote_directory'])
end
def connection