Commit 45d99c92 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Unify deployment_platform interface with CE

Make sure we override the method from CE, too
parent fe1a3903
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 ||
......
...@@ -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
......
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment