Set `runner_type` for cluster/application
This commit is contained in:
parent
09747ecd33
commit
a57c953e0e
|
@ -43,12 +43,20 @@ module Clusters
|
||||||
|
|
||||||
def create_and_assign_runner
|
def create_and_assign_runner
|
||||||
transaction do
|
transaction do
|
||||||
project.runners.create!(name: 'kubernetes-cluster', tag_list: %w(kubernetes cluster)).tap do |runner|
|
project.runners.create!(runner_create_params).tap do |runner|
|
||||||
update!(runner_id: runner.id)
|
update!(runner_id: runner.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def runner_create_params
|
||||||
|
{
|
||||||
|
name: 'kubernetes-cluster',
|
||||||
|
runner_type: :project_type,
|
||||||
|
tag_list: %w(kubernetes cluster)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def gitlab_url
|
def gitlab_url
|
||||||
Gitlab::Routing.url_helpers.root_url(only_path: false)
|
Gitlab::Routing.url_helpers.root_url(only_path: false)
|
||||||
end
|
end
|
||||||
|
|
|
@ -74,9 +74,8 @@ describe Clusters::Applications::Runner do
|
||||||
|
|
||||||
it 'assigns the new runner to runner' do
|
it 'assigns the new runner to runner' do
|
||||||
subject
|
subject
|
||||||
gitlab_runner.reload
|
|
||||||
|
|
||||||
expect(gitlab_runner.runner).not_to be_nil
|
expect(gitlab_runner.reload.runner).to be_project_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue