summaryrefslogtreecommitdiff
path: root/app/services/clusters/applications/create_service.rb
blob: f723c42c04959ecf7892503638852863ae5b6c54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Clusters
  module Applications
    class CreateService < Clusters::Applications::BaseService
      private

      def worker_class(application)
        application.updateable? ? ClusterUpgradeAppWorker : ClusterInstallAppWorker
      end

      def builder
        cluster.public_send(:"application_#{application_name}") || # rubocop:disable GitlabSecurity/PublicSend
          cluster.public_send(:"build_application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
      end
    end
  end
end