Commit e4c6d370 authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch '353355-update-container-registry-import-request-parameters' into 'master'

Update import request parameters

See merge request gitlab-org/gitlab!81797
parents cee5f227 745e30d6
......@@ -75,7 +75,7 @@ module ContainerRegistry
def start_import_for(path, pre:)
with_import_token_faraday do |faraday_client|
faraday_client.put(import_url_for(path)) do |req|
req.params['pre'] = pre.to_s
req.params['import_type'] = pre ? 'pre' : 'final'
end
end
end
......
......@@ -217,7 +217,8 @@ RSpec.describe ContainerRegistry::GitlabApiClient do
end
def stub_pre_import(path, status_code, pre:)
stub_request(:put, "#{registry_api_url}/gitlab/v1/import/#{path}/?pre=#{pre}")
import_type = pre ? 'pre' : 'final'
stub_request(:put, "#{registry_api_url}/gitlab/v1/import/#{path}/?import_type=#{import_type}")
.with(headers: { 'Accept' => described_class::JSON_TYPE, 'Authorization' => "bearer #{import_token}" })
.to_return(status: status_code, body: '')
end
......
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