Commit 4ed265a4 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-workhorse-default-region' into 'master'

Set a default region to Workhorse S3 client

See merge request gitlab-org/gitlab!59932
parents 08eb7fac 07958747
---
title: Set a default region to Workhorse S3 client
merge_request: 59932
author:
type: fixed
...@@ -79,7 +79,7 @@ module ObjectStorage ...@@ -79,7 +79,7 @@ module ObjectStorage
Provider: 'AWS', Provider: 'AWS',
S3Config: { S3Config: {
Bucket: bucket_name, Bucket: bucket_name,
Region: credentials[:region], Region: credentials[:region] || ::Fog::AWS::Storage::DEFAULT_REGION,
Endpoint: credentials[:endpoint], Endpoint: credentials[:endpoint],
PathStyle: config.use_path_style?, PathStyle: config.use_path_style?,
UseIamProfile: config.use_iam_profile?, UseIamProfile: config.use_iam_profile?,
......
...@@ -126,6 +126,16 @@ RSpec.describe ObjectStorage::DirectUpload do ...@@ -126,6 +126,16 @@ RSpec.describe ObjectStorage::DirectUpload do
expect(s3_config.keys).not_to include(%i(ServerSideEncryption SSEKMSKeyID)) expect(s3_config.keys).not_to include(%i(ServerSideEncryption SSEKMSKeyID))
end end
context 'when no region is specified' do
before do
raw_config.delete(:region)
end
it 'defaults to us-east-1' do
expect(subject[:ObjectStorage][:S3Config][:Region]).to eq('us-east-1')
end
end
context 'when feature flag is disabled' do context 'when feature flag is disabled' do
before do before do
stub_feature_flags(use_workhorse_s3_client: false) stub_feature_flags(use_workhorse_s3_client: false)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment