Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a33f0126
Commit
a33f0126
authored
Mar 09, 2020
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use terraform_state storage config
parent
b21e823c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
app/uploaders/terraform_state_uploader.rb
app/uploaders/terraform_state_uploader.rb
+1
-1
spec/support/helpers/stub_object_storage.rb
spec/support/helpers/stub_object_storage.rb
+7
-0
spec/uploaders/terraform_state_uploader_spec.rb
spec/uploaders/terraform_state_uploader_spec.rb
+1
-1
No files found.
app/uploaders/terraform_state_uploader.rb
View file @
a33f0126
...
...
@@ -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
...
...
spec/support/helpers/stub_object_storage.rb
View file @
a33f0126
...
...
@@ -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
...
...
spec/uploaders/terraform_state_uploader_spec.rb
View file @
a33f0126
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment