diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/uploaders/terraform | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/uploaders/terraform')
-rw-r--r-- | app/uploaders/terraform/versioned_state_uploader.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/uploaders/terraform/versioned_state_uploader.rb b/app/uploaders/terraform/versioned_state_uploader.rb index be07993da0f..e50ab6c7dc6 100644 --- a/app/uploaders/terraform/versioned_state_uploader.rb +++ b/app/uploaders/terraform/versioned_state_uploader.rb @@ -2,12 +2,22 @@ module Terraform class VersionedStateUploader < StateUploader + delegate :terraform_state, to: :model + def filename - "#{model.version}.tfstate" + if terraform_state.versioning_enabled? + "#{model.version}.tfstate" + else + "#{model.uuid}.tfstate" + end end def store_dir - Gitlab::HashedPath.new(model.uuid, root_hash: project_id) + if terraform_state.versioning_enabled? + Gitlab::HashedPath.new(model.uuid, root_hash: project_id) + else + project_id.to_s + end end end end |