Commit a33f0126 authored by Alishan Ladhani's avatar Alishan Ladhani

Use terraform_state storage config

parent b21e823c
......@@ -3,7 +3,7 @@
class TerraformStateUploader < GitlabUploader
include ObjectStorage::Concern
storage_options Gitlab.config.uploads
storage_options Gitlab.config.terraform_state
delegate :project_id, to: :model
......
......@@ -70,6 +70,13 @@ module StubObjectStorage
**params)
end
def stub_terraform_state_object_storage(uploader = described_class, **params)
stub_object_storage_uploader(config: Gitlab.config.terraform_state.object_store,
uploader: uploader,
remote_directory: 'terraform_state',
**params)
end
def stub_object_storage_multipart_init(endpoint, upload_id = "upload_id")
stub_request(:post, %r{\A#{endpoint}tmp/uploads/[a-z0-9-]*\?uploads\z})
.to_return status: 200, body: <<-EOS.strip_heredoc
......
......@@ -8,7 +8,7 @@ describe TerraformStateUploader do
let(:terraform_state) { create(:terraform_state, file: fixture_file_upload('spec/fixtures/terraform.tfstate')) }
before do
stub_uploads_object_storage
stub_terraform_state_object_storage
end
describe '#filename' do
......
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