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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /lib/object_storage/direct_upload.rb
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'lib/object_storage/direct_upload.rb')
-rw-r--r--lib/object_storage/direct_upload.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/object_storage/direct_upload.rb b/lib/object_storage/direct_upload.rb
index d092cd56e46..9449e51b053 100644
--- a/lib/object_storage/direct_upload.rb
+++ b/lib/object_storage/direct_upload.rb
@@ -66,6 +66,8 @@ module ObjectStorage
workhorse_aws_hash
elsif config.azure?
workhorse_azure_hash
+ elsif Feature.enabled?(:workhorse_google_client) && config.google?
+ workhorse_google_hash
else
{}
end
@@ -111,6 +113,23 @@ module ObjectStorage
url
end
+ def workhorse_google_hash
+ {
+ UseWorkhorseClient: use_workhorse_google_client?,
+ RemoteTempObjectID: object_name,
+ ObjectStorage: {
+ Provider: 'Google',
+ GoCloudConfig: {
+ URL: google_gocloud_url
+ }
+ }
+ }
+ end
+
+ def google_gocloud_url
+ "gs://#{bucket_name}"
+ end
+
def use_workhorse_s3_client?
return false unless config.use_iam_profile? || config.consolidated_settings?
# The Golang AWS SDK does not support V2 signatures
@@ -119,6 +138,15 @@ module ObjectStorage
true
end
+ def use_workhorse_google_client?
+ return false unless config.consolidated_settings?
+ return true if credentials[:google_application_default]
+ return true if credentials[:google_json_key_location]
+ return true if credentials[:google_json_key_string]
+
+ false
+ end
+
def provider
credentials[:provider].to_s
end