2018-10-09 23:47:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Clusters
|
|
|
|
module Applications
|
2019-02-18 12:06:51 -05:00
|
|
|
class CreateService < Clusters::Applications::BaseService
|
2018-10-09 23:47:27 -04:00
|
|
|
private
|
|
|
|
|
2019-02-18 12:06:51 -05:00
|
|
|
def worker_class(application)
|
|
|
|
application.updateable? ? ClusterUpgradeAppWorker : ClusterInstallAppWorker
|
2018-10-09 23:47:27 -04:00
|
|
|
end
|
|
|
|
|
2019-04-01 09:32:20 -04:00
|
|
|
def builder
|
2019-09-17 08:06:48 -04:00
|
|
|
cluster.public_send(application_class.association_name) || # rubocop:disable GitlabSecurity/PublicSend
|
2019-04-25 23:27:06 -04:00
|
|
|
cluster.public_send(:"build_application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
|
2018-10-09 23:47:27 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|