From d2612b42b9da6638d70b9d7144f6d427070d042d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 5 Jul 2022 10:20:03 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-1-stable-ee --- app/uploaders/object_storage.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'app/uploaders/object_storage.rb') 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. -- cgit v1.2.1