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

destroy_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: d666682487bff7e01a092285ac1225ca504992ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module Clusters
  module Applications
    class DestroyService < ::Clusters::Applications::BaseService
      def execute(_request)
        instantiate_application.tap do |application|
          break unless application.can_uninstall?

          application.make_scheduled!

          Clusters::Applications::UninstallWorker.perform_async(application.name, application.id)
        end
      end

      private

      def builder
        cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
      end
    end
  end
end