summaryrefslogtreecommitdiff
path: root/app/services/clusters/applications/fetch_installation_status_service.rb
blob: 3d082485532bcb134c1a6d53ae69429c75760291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Clusters
  module Applications
    class FetchInstallationStatusService < BaseHelmService
      def execute
        return unless app.installing?

        phase = helm_api.installation_status(app)
        log = helm_api.installation_log(app) if phase == 'Failed'
        yield(phase, log) if block_given?
      rescue KubeException => ke
        app.make_errored!("Kubernetes error: #{ke.message}") unless app.errored?
      end
    end
  end
end