debian-mirror-gitlab/app/services/clusters/applications/destroy_service.rb

24 lines
595 B
Ruby
Raw Normal View History

2019-07-31 22:56:46 +05:30
# 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
2019-12-04 20:38:33 +05:30
cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
2019-07-31 22:56:46 +05:30
end
end
end
end