gitlab-org--gitlab-foss/app/services/clusters/applications/install_service.rb

24 lines
639 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-11-02 13:55:02 -04:00
module Clusters
module Applications
class InstallService < BaseHelmService
def execute
return unless app.scheduled?
2019-03-06 06:50:39 -05:00
app.make_installing!
helm_api.install(install_command)
2017-11-02 13:55:02 -04:00
2019-03-06 06:50:39 -05:00
ClusterWaitForAppInstallationWorker.perform_in(
ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id)
rescue Kubeclient::HttpError => e
log_error(e)
app.make_errored!("Kubernetes error: #{e.error_code}")
rescue StandardError => e
log_error(e)
app.make_errored!("Can't start installation process.")
2017-11-02 13:55:02 -04:00
end
end
end
end