Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-25 01:16:59 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-25 01:16:59 +0300
commitae5079ea12a3ffc8d8b89db738a63fd2978b8e69 (patch)
tree4ff7b12519c4388f0a4c5d74c6ebe4a1e4ffdd6e /app
parentbe59e761f2082afdcb4dd1f012bdc98643160f61 (diff)
Add latest changes from gitlab-org/gitlab@16-2-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/uploaders/object_storage.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb
index 672433ec534..a8328304e73 100644
--- a/app/uploaders/object_storage.rb
+++ b/app/uploaders/object_storage.rb
@@ -31,7 +31,8 @@ module ObjectStorage
# The direct_upload_final_path is defined which means
# file was uploaded to its final location so no need to move it.
# Now we delete the pending upload entry as the upload is considered complete.
- ObjectStorage::PendingDirectUpload.complete(@uploader.class.storage_location_identifier, file.path)
+ pending_upload_path = @uploader.class.without_bucket_prefix(file.path)
+ ObjectStorage::PendingDirectUpload.complete(@uploader.class.storage_location_identifier, pending_upload_path)
file
end
@@ -196,6 +197,10 @@ module ObjectStorage
File.join([object_store_options.bucket_prefix, path].compact)
end
+ def without_bucket_prefix(path)
+ Pathname.new(path).relative_path_from(object_store_options.bucket_prefix.to_s).to_s
+ end
+
def object_store_config
ObjectStorage::Config.new(object_store_options)
end