diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-05 10:20:03 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-05 10:20:03 +0000 |
commit | d2612b42b9da6638d70b9d7144f6d427070d042d (patch) | |
tree | ed7de87d4b112cae8a45ba186d717ca9768c7d4e /app/uploaders/object_storage.rb | |
parent | d80373b353005e70f44eca8a3bc4a4c5cfbf0e9e (diff) | |
download | gitlab-ce-d2612b42b9da6638d70b9d7144f6d427070d042d.tar.gz |
Add latest changes from gitlab-org/gitlab@15-1-stable-ee
Diffstat (limited to 'app/uploaders/object_storage.rb')
-rw-r--r-- | app/uploaders/object_storage.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb index 1d56cddca63..891df5180d8 100644 --- a/app/uploaders/object_storage.rb +++ b/app/uploaders/object_storage.rb @@ -353,6 +353,20 @@ module ObjectStorage } end + def store_path(*args) + if self.object_store == Store::REMOTE + # We allow administrators to create "sub buckets" by setting a prefix. + # This makes it possible to deploy GitLab with only one object storage + # bucket. Because the prefix is configuration data we do not want to + # store it in the uploads table via RecordsUploads. That means that the + # prefix cannot be part of store_dir. This is why we chose to implement + # the prefix support here in store_path. + File.join([self.class.object_store_options.bucket_prefix, super].compact) + else + super + end + end + # Returns all the possible paths for an upload. # the `upload.path` is a lookup parameter, and it may change # depending on the `store` param. |