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
45d99c92
Commit
45d99c92
authored
Mar 07, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify deployment_platform interface with CE
Make sure we override the method from CE, too
parent
fe1a3903
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/concerns/deployment_platform.rb
app/models/concerns/deployment_platform.rb
+1
-0
app/models/environment.rb
app/models/environment.rb
+4
-4
ee/app/models/concerns/ee/deployment_platform.rb
ee/app/models/concerns/ee/deployment_platform.rb
+3
-0
No files found.
app/models/concerns/deployment_platform.rb
View file @
45d99c92
module
DeploymentPlatform
module
DeploymentPlatform
# EE would override this and utilize the extra argument
def
deployment_platform
(
environment:
nil
)
def
deployment_platform
(
environment:
nil
)
@deployment_platform
||=
@deployment_platform
||=
find_cluster_platform_kubernetes
||
find_cluster_platform_kubernetes
||
...
...
app/models/environment.rb
View file @
45d99c92
...
@@ -137,10 +137,6 @@ class Environment < ActiveRecord::Base
...
@@ -137,10 +137,6 @@ class Environment < ActiveRecord::Base
end
end
end
end
def
deployment_platform
project
.
deployment_platform
(
environment:
self
)
end
def
has_terminals?
def
has_terminals?
deployment_platform
.
present?
&&
available?
&&
last_deployment
.
present?
deployment_platform
.
present?
&&
available?
&&
last_deployment
.
present?
end
end
...
@@ -234,6 +230,10 @@ class Environment < ActiveRecord::Base
...
@@ -234,6 +230,10 @@ class Environment < ActiveRecord::Base
self
.
environment_type
||
self
.
name
self
.
environment_type
||
self
.
name
end
end
def
deployment_platform
project
.
deployment_platform
(
environment:
self
)
end
private
private
# Slugifying a name may remove the uniqueness guarantee afforded by it being
# Slugifying a name may remove the uniqueness guarantee afforded by it being
...
...
ee/app/models/concerns/ee/deployment_platform.rb
View file @
45d99c92
module
EE
module
EE
module
DeploymentPlatform
module
DeploymentPlatform
extend
::
Gitlab
::
Utils
::
Override
override
:deployment_platform
def
deployment_platform
(
environment:
nil
)
def
deployment_platform
(
environment:
nil
)
return
super
unless
environment
&&
feature_available?
(
:multiple_clusters
)
return
super
unless
environment
&&
feature_available?
(
:multiple_clusters
)
...
...
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