diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 09:08:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 09:08:27 +0000 |
commit | 15ae4a8da83661f2b714d804721001a53b354d28 (patch) | |
tree | 91080b2b969a66857d78fb9008c1d0c367132a8d /app/uploaders | |
parent | 8f71e69fdbb65d2cf95cf16ef5a0add0919edb45 (diff) | |
download | gitlab-ce-15ae4a8da83661f2b714d804721001a53b354d28.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/uploaders')
-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 |