summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications/runner.rb
diff options
context:
space:
mode:
authorKamil TrzciƄski <ayufan@ayufan.eu>2018-05-08 22:39:28 +0200
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-09 06:57:40 +0200
commita57c953e0e6ca03f929fb59f13307405822dfcb9 (patch)
tree73d0b907e2811f75a5346f546b325b4a1ffd8fe2 /app/models/clusters/applications/runner.rb
parent09747ecd3317fc2e1be54f4c944b718f5edf4ae9 (diff)
downloadgitlab-ce-a57c953e0e6ca03f929fb59f13307405822dfcb9.tar.gz
Set `runner_type` for cluster/application
Diffstat (limited to 'app/models/clusters/applications/runner.rb')
-rw-r--r--app/models/clusters/applications/runner.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index 16efe90fa27..b881b4eaf36 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -43,12 +43,20 @@ module Clusters
def create_and_assign_runner
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)
end
end
end
+ def runner_create_params
+ {
+ name: 'kubernetes-cluster',
+ runner_type: :project_type,
+ tag_list: %w(kubernetes cluster)
+ }
+ end
+
def gitlab_url
Gitlab::Routing.url_helpers.root_url(only_path: false)
end