diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-09 09:55:20 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-05-09 12:02:26 +0300 |
commit | ae992c6a85018462c775457c3d8af15022a2e17f (patch) | |
tree | 821f01e099be45370bd9d74f40d89a4d8ce35ad7 /app | |
parent | 7c3c068537d2186dba414f68a78e85fe34b36f78 (diff) |
Merge branch 'add-runner-type-to-cluster-app' into 'master'
Set `runner_type` for cluster/application
See merge request gitlab-org/gitlab-ce!18832
Diffstat (limited to 'app')
-rw-r--r-- | app/models/clusters/applications/runner.rb | 10 |
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 |