diff options
Diffstat (limited to 'app/services/clusters/applications/create_service.rb')
-rw-r--r-- | app/services/clusters/applications/create_service.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/app/services/clusters/applications/create_service.rb b/app/services/clusters/applications/create_service.rb index c6f729aaa8a..ae36da7b3dd 100644 --- a/app/services/clusters/applications/create_service.rb +++ b/app/services/clusters/applications/create_service.rb @@ -9,25 +9,9 @@ module Clusters application.updateable? ? ClusterUpgradeAppWorker : ClusterInstallAppWorker end - def builders - { - "helm" => -> (cluster) { cluster.application_helm || cluster.build_application_helm }, - "ingress" => -> (cluster) { cluster.application_ingress || cluster.build_application_ingress }, - "cert_manager" => -> (cluster) { cluster.application_cert_manager || cluster.build_application_cert_manager }, - "runner" => -> (cluster) { cluster.application_runner || cluster.build_application_runner } - }.tap do |hash| - hash.merge!(project_builders) if cluster.project_type? - end - end - - # These applications will need extra configuration to enable them to work - # with groups of projects - def project_builders - { - "prometheus" => -> (cluster) { cluster.application_prometheus || cluster.build_application_prometheus }, - "jupyter" => -> (cluster) { cluster.application_jupyter || cluster.build_application_jupyter }, - "knative" => -> (cluster) { cluster.application_knative || cluster.build_application_knative } - } + def builder + cluster.method("application_#{application_name}").call || + cluster.method("build_application_#{application_name}").call end end end |