summaryrefslogtreecommitdiff
path: root/app/services/clusters/fetch_app_installation_status_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/clusters/fetch_app_installation_status_service.rb')
-rw-r--r--app/services/clusters/fetch_app_installation_status_service.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/clusters/fetch_app_installation_status_service.rb b/app/services/clusters/fetch_app_installation_status_service.rb
new file mode 100644
index 00000000000..e21aa49bb43
--- /dev/null
+++ b/app/services/clusters/fetch_app_installation_status_service.rb
@@ -0,0 +1,13 @@
+module Clusters
+ class FetchAppInstallationStatusService < BaseHelmService
+ def execute
+ return unless app.installing?
+
+ phase = helm.installation_status(app)
+ log = helm.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