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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
01dc3c96
Commit
01dc3c96
authored
Dec 10, 2018
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to re-use similar block
parent
22289352
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
app/controllers/clusters/clusters_controller.rb
app/controllers/clusters/clusters_controller.rb
+9
-3
No files found.
app/controllers/clusters/clusters_controller.rb
View file @
01dc3c96
...
@@ -181,14 +181,20 @@ class Clusters::ClustersController < Clusters::BaseController
...
@@ -181,14 +181,20 @@ class Clusters::ClustersController < Clusters::BaseController
end
end
def
gcp_cluster
def
gcp_cluster
@gcp_cluster
=
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
@gcp_cluster
=
new_cluster
do
|
cluster
|
cluster
.
build_provider_gcp
cluster
.
build_provider_gcp
end
.
present
(
current_user:
current_user
)
end
end
end
def
user_cluster
def
user_cluster
@user_cluster
=
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
@user_cluster
=
new_cluster
do
|
cluster
|
cluster
.
build_platform_kubernetes
cluster
.
build_platform_kubernetes
end
end
def
new_cluster
::
Clusters
::
Cluster
.
new
.
tap
do
|
cluster
|
yield
cluster
case
clusterable
.
subject
case
clusterable
.
subject
when
::
Project
when
::
Project
...
...
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