From 85dc423f7090da0a52c73eb66faf22ddb20efff9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 19 Sep 2020 01:45:44 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-4-stable-ee --- lib/api/terraform/state.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/api/terraform') diff --git a/lib/api/terraform/state.rb b/lib/api/terraform/state.rb index f6e966defce..7063a3d08b5 100644 --- a/lib/api/terraform/state.rb +++ b/lib/api/terraform/state.rb @@ -35,10 +35,10 @@ module API route_setting :authentication, basic_auth_personal_access_token: true, job_token_allowed: :basic_auth get do remote_state_handler.find_with_lock do |state| - no_content! unless state.file.exists? + no_content! unless state.latest_file && state.latest_file.exists? env['api.format'] = :binary # this bypasses json serialization - body state.file.read + body state.latest_file.read status :ok end end @@ -52,8 +52,7 @@ module API no_content! if data.empty? remote_state_handler.handle_with_lock do |state| - state.file = CarrierWaveStringFile.new(data) - state.save! + state.update_file!(CarrierWaveStringFile.new(data), version: params[:serial]) status :ok end end -- cgit v1.2.3