Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/clusters/concerns/application_status.rb')
-rw-r--r--app/models/clusters/concerns/application_status.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb
index 0b915126f8a..86d74ed7b1c 100644
--- a/app/models/clusters/concerns/application_status.rb
+++ b/app/models/clusters/concerns/application_status.rb
@@ -97,13 +97,21 @@ module Clusters
application.status_reason = status_reason if status_reason
end
- before_transition any => [:installed, :updated] do |application, _|
- # When installing any application we are also performing an update
- # of tiller (see Gitlab::Kubernetes::Helm::ClientCommand) so
- # therefore we need to reflect that in the database.
-
- unless ::Gitlab::Kubernetes::Helm.local_tiller_enabled?
- application.cluster.application_helm.update!(version: Gitlab::Kubernetes::Helm::HELM_VERSION)
+ before_transition any => [:installed, :updated] do |application, transition|
+ unless application.cluster.local_tiller_enabled? || application.is_a?(Clusters::Applications::Helm)
+ if transition.event == :make_externally_installed
+ # If an application is externally installed
+ # We assume the helm application is externally installed too
+ helm = application.cluster.application_helm || application.cluster.build_application_helm
+
+ helm.make_externally_installed!
+ else
+ # When installing any application we are also performing an update
+ # of tiller (see Gitlab::Kubernetes::Helm::ClientCommand) so
+ # therefore we need to reflect that in the database.
+
+ application.cluster.application_helm.update!(version: Gitlab::Kubernetes::Helm::HELM_VERSION)
+ end
end
end