Commit 587d8e13 authored by Shinya Maeda's avatar Shinya Maeda

Extend deployment_platform selector for environment_scope

parent e696d138
......@@ -905,9 +905,11 @@ class Project < ActiveRecord::Base
@ci_service ||= ci_services.reorder(nil).find_by(active: true)
end
# TODO: This will be extended for multiple enviroment clusters
def deployment_platform
@deployment_platform ||= clusters.find_by(enabled: true)&.platform_kubernetes
@deployment_platform ||= clusters.select do |cluster|
cluster.matches?(environment) # TODO: This is the same logic with Environment Variable
end.first&.platform_kubernetes
@deployment_platform ||= services.where(category: :deployment).reorder(nil).find_by(active: true)
end
......
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