diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-05 17:49:40 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 13:57:41 +0200 |
commit | 62f053e4e50dd04933d49622a74dcb89ebe8174e (patch) | |
tree | c1fdd2206fff93531d78267cc6edc9dc4d1a9622 | |
parent | d02694c5c53265ccd9e8a51a52dc8bb8bcbff656 (diff) | |
download | gitlab-ce-62f053e4e50dd04933d49622a74dcb89ebe8174e.tar.gz |
Update runner registration API
-rw-r--r-- | lib/api/runner.rb | 5 | ||||
-rw-r--r-- | spec/requests/api/runner_spec.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/runner.rb b/lib/api/runner.rb index 74ddaf26bb6..73d5993701c 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -14,11 +14,12 @@ module API optional :locked, type: Boolean, desc: 'Should Runner be locked for current project' optional :run_untagged, type: Boolean, desc: 'Should Runner handle untagged jobs' optional :tag_list, type: Array[String], desc: %q(List of Runner's tags) - optional :maximum_job_timeout_human_readable, type: String, desc: 'Maximum timeout set when this Runner will handle the job' + optional :maximum_job_timeout, type: String, desc: 'Maximum timeout set when this Runner will handle the job' end post '/' do - attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list, :maximum_job_timeout_human_readable]) + attributes = attributes_for_keys([:description, :locked, :run_untagged, :tag_list]) .merge(get_runner_details_from_request) + .merge(maximum_job_timeout_human_readable: params[:maximum_job_timeout]) runner = if runner_registration_token_valid? diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb index 55c4150a393..0ca7ba7154e 100644 --- a/spec/requests/api/runner_spec.rb +++ b/spec/requests/api/runner_spec.rb @@ -112,7 +112,7 @@ describe API::Runner do context 'when maximum job timeout is specified' do it 'creates runner' do post api('/runners'), token: registration_token, - maximum_job_timeout_human_readable: '2h 30m' + maximum_job_timeout: '2h 30m' expect(response).to have_gitlab_http_status 201 expect(Ci::Runner.first.maximum_job_timeout).to eq(9000) @@ -121,7 +121,7 @@ describe API::Runner do context 'when maximum job timeout is empty' do it 'creates runner' do post api('/runners'), token: registration_token, - maximum_job_timeout_human_readable: '' + maximum_job_timeout: '' expect(response).to have_gitlab_http_status 201 expect(Ci::Runner.first.maximum_job_timeout).to be_nil |