diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 17:26:14 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 19:12:41 +0300 |
commit | 8ec618a6ede619d9f75279f03c03b24d106c79c7 (patch) | |
tree | 7fe8501fb56edf3f33febe5c0d39019160715293 /app | |
parent | 760a154a032319a90e15dcf4d54ec1c1cdde9e1c (diff) |
Add Helm InstallCommand
Diffstat (limited to 'app')
4 files changed, 12 insertions, 4 deletions
diff --git a/app/models/clusters/applications/helm.rb b/app/models/clusters/applications/helm.rb index 7ea84841118..c7949d11ef8 100644 --- a/app/models/clusters/applications/helm.rb +++ b/app/models/clusters/applications/helm.rb @@ -26,6 +26,10 @@ module Clusters def name self.class.application_name end + + def install_command + Gitlab::Kubernetes::Helm::InstallCommand.new(name, true) + end end end end diff --git a/app/services/clusters/applications/base_helm_service.rb b/app/services/clusters/applications/base_helm_service.rb index 68320a3b267..9a4ce31cb39 100644 --- a/app/services/clusters/applications/base_helm_service.rb +++ b/app/services/clusters/applications/base_helm_service.rb @@ -20,6 +20,10 @@ module Clusters def helm_api @helm_api ||= Gitlab::Kubernetes::Helm.new(kubeclient) end + + def install_command + @install_command ||= app.install_command + end end end end diff --git a/app/services/clusters/applications/check_installation_progress_service.rb b/app/services/clusters/applications/check_installation_progress_service.rb index 69bd3613cce..bde090eaeec 100644 --- a/app/services/clusters/applications/check_installation_progress_service.rb +++ b/app/services/clusters/applications/check_installation_progress_service.rb @@ -48,17 +48,17 @@ module Clusters end def remove_installation_pod - helm_api.delete_installation_pod!(app) + helm_api.delete_installation_pod!(install_command.pod_name) rescue # no-op end def installation_phase - helm_api.installation_status(app) + helm_api.installation_status(install_command.pod_name) end def installation_errors - helm_api.installation_log(app) + helm_api.installation_log(install_command.pod_name) end end end diff --git a/app/services/clusters/applications/install_service.rb b/app/services/clusters/applications/install_service.rb index 4eba19a474e..8ceeec687cd 100644 --- a/app/services/clusters/applications/install_service.rb +++ b/app/services/clusters/applications/install_service.rb @@ -6,7 +6,7 @@ module Clusters begin app.make_installing! - helm_api.install(app) + helm_api.install(install_command) ClusterWaitForAppInstallationWorker.perform_in( ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) |