diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/clusters/applications/helm.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/applications/ingress.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/applications/prometheus.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/applications/runner.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_status.rb | 2 |
5 files changed, 2 insertions, 8 deletions
diff --git a/app/models/clusters/applications/helm.rb b/app/models/clusters/applications/helm.rb index f7dfae56df6..58de3448577 100644 --- a/app/models/clusters/applications/helm.rb +++ b/app/models/clusters/applications/helm.rb @@ -8,8 +8,6 @@ module Clusters default_value_for :version, Gitlab::Kubernetes::Helm::HELM_VERSION - scope :installed, -> { where(status: ::Clusters::Applications::Helm.state_machines[:status].states[:installed].value) } - def set_initial_status return unless not_installable? diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb index 8cd88e8aeaf..27fc3b85465 100644 --- a/app/models/clusters/applications/ingress.rb +++ b/app/models/clusters/applications/ingress.rb @@ -11,8 +11,6 @@ module Clusters default_value_for :ingress_type, :nginx default_value_for :version, :nginx - scope :installed, -> { where(status: ::Clusters::Applications::Ingress.state_machines[:status].states[:installed].value) } - enum ingress_type: { nginx: 1 } diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 2ae3e006047..7b25d8c4089 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -13,8 +13,6 @@ module Clusters default_value_for :version, VERSION - scope :installed, -> { where(status: ::Clusters::Applications::Prometheus.state_machines[:status].states[:installed].value) } - state_machine :status do after_transition any => [:installed] do |application| application.cluster.projects.each do |project| diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb index 6dc51d1baa4..16efe90fa27 100644 --- a/app/models/clusters/applications/runner.rb +++ b/app/models/clusters/applications/runner.rb @@ -14,8 +14,6 @@ module Clusters default_value_for :version, VERSION - scope :installed, -> { where(status: ::Clusters::Applications::Runner.state_machines[:status].states[:installed].value) } - def chart "#{name}/gitlab-runner" end diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb index 7b7c8eac773..8f3eb75bfa9 100644 --- a/app/models/clusters/concerns/application_status.rb +++ b/app/models/clusters/concerns/application_status.rb @@ -4,6 +4,8 @@ module Clusters extend ActiveSupport::Concern included do + scope :installed, -> { where(status: self.state_machines[:status].states[:installed].value) } + state_machine :status, initial: :not_installable do state :not_installable, value: -2 state :errored, value: -1 |