diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/models/clusters/concerns | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r-- | app/models/clusters/concerns/application_core.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_data.rb | 5 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_status.rb | 22 |
3 files changed, 19 insertions, 10 deletions
diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb index 297d00aa281..c1f63758906 100644 --- a/app/models/clusters/concerns/application_core.rb +++ b/app/models/clusters/concerns/application_core.rb @@ -15,7 +15,7 @@ module Clusters def set_initial_status return unless not_installable? - self.status = status_states[:installable] if cluster&.application_helm_available? || ::Gitlab::Kubernetes::Helm.local_tiller_enabled? + self.status = status_states[:installable] if cluster&.application_helm_available? || cluster&.local_tiller_enabled? end def can_uninstall? diff --git a/app/models/clusters/concerns/application_data.rb b/app/models/clusters/concerns/application_data.rb index 77c606553d2..ade27e69642 100644 --- a/app/models/clusters/concerns/application_data.rb +++ b/app/models/clusters/concerns/application_data.rb @@ -7,7 +7,8 @@ module Clusters Gitlab::Kubernetes::Helm::DeleteCommand.new( name: name, rbac: cluster.platform_kubernetes_rbac?, - files: files + files: files, + local_tiller_enabled: cluster.local_tiller_enabled? ) end @@ -32,7 +33,7 @@ module Clusters private def use_tiller_ssl? - return false if ::Gitlab::Kubernetes::Helm.local_tiller_enabled? + return false if cluster.local_tiller_enabled? cluster.application_helm.has_ssl? end 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 |