From 6f7881ee9dcec34141a8f34fc814b56b366d2b48 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 24 Mar 2020 09:09:25 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/models/clusters/applications/ingress.rb | 6 +++--- app/models/clusters/applications/prometheus.rb | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'app/models/clusters') diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb index 78c2a74da33..baf34e916f8 100644 --- a/app/models/clusters/applications/ingress.rb +++ b/app/models/clusters/applications/ingress.rb @@ -50,7 +50,7 @@ module Clusters end def allowed_to_uninstall? - external_ip_or_hostname? && application_jupyter_nil_or_installable? + external_ip_or_hostname? && !application_jupyter_installed? end def install_command @@ -161,8 +161,8 @@ module Clusters YAML.load_file(chart_values_file).deep_merge!(specification) end - def application_jupyter_nil_or_installable? - cluster.application_jupyter.nil? || cluster.application_jupyter&.installable? + def application_jupyter_installed? + cluster.application_jupyter&.installed? end def modsecurity_snippet_content diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 8297f653ea7..3183318690c 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -35,6 +35,16 @@ module Clusters .perform_async(application.cluster_id, ::PrometheusService.to_param) # rubocop:disable CodeReuse/ServiceClass end end + + after_transition any => :updating do |application| + application.update(last_update_started_at: Time.now) + end + end + + def updated_since?(timestamp) + last_update_started_at && + last_update_started_at > timestamp && + !update_errored? end def chart @@ -148,5 +158,3 @@ module Clusters end end end - -Clusters::Applications::Prometheus.prepend_if_ee('EE::Clusters::Applications::Prometheus') -- cgit v1.2.1