Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a57c953e
Commit
a57c953e
authored
May 08, 2018
by
Kamil Trzciński
Committed by
Dylan Griffith
May 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set `runner_type` for cluster/application
parent
09747ecd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
app/models/clusters/applications/runner.rb
app/models/clusters/applications/runner.rb
+9
-1
spec/models/clusters/applications/runner_spec.rb
spec/models/clusters/applications/runner_spec.rb
+1
-2
No files found.
app/models/clusters/applications/runner.rb
View file @
a57c953e
...
@@ -43,12 +43,20 @@ module Clusters
...
@@ -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
...
...
spec/models/clusters/applications/runner_spec.rb
View file @
a57c953e
...
@@ -74,9 +74,8 @@ describe Clusters::Applications::Runner do
...
@@ -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
.
r
unner
).
not_to
be_nil
expect
(
gitlab_runner
.
r
eload
.
runner
).
to
be_project_type
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment