Welcome to mirror list, hosted at ThFree Co, Russian Federation.

schedule_installation_service.rb « applications « clusters « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: eb8caa68ef75ab4dddda42a71e7e94fb926a0d1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Clusters
  module Applications
    class ScheduleInstallationService < ::BaseService
      def execute
        application_class.find_or_create_by!(cluster: cluster).try do |application|
          application.make_scheduled!
          ClusterInstallAppWorker.perform_async(application.name, application.id)
        end
      end

      private

      def application_class
        params[:application_class]
      end

      def cluster
        params[:cluster]
      end
    end
  end
end