diff options
Diffstat (limited to 'app/services/clusters/applications/fetch_installation_status_service.rb')
-rw-r--r-- | app/services/clusters/applications/fetch_installation_status_service.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/services/clusters/applications/fetch_installation_status_service.rb b/app/services/clusters/applications/fetch_installation_status_service.rb new file mode 100644 index 00000000000..3d082485532 --- /dev/null +++ b/app/services/clusters/applications/fetch_installation_status_service.rb @@ -0,0 +1,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 |