diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2018-10-15 12:03:15 +0300 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2018-10-16 10:16:43 +0300 |
commit | 3a3ec6f0213addb52abc29ee83e2d6a00e2292d3 (patch) | |
tree | 42d2840271155af848cbe22d20a50c5757f82fa2 /app/models/clusters | |
parent | 6ea674d1796488f784083eab53becb86330343cb (diff) |
Show available clusters when installed or updated
Before this commit updating Prometheus (e.g. adding alerts) made it
"updated" therefore not installed.
Diffstat (limited to 'app/models/clusters')
-rw-r--r-- | app/models/clusters/applications/jupyter.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/cluster.rb | 5 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_core.rb | 2 | ||||
-rw-r--r-- | app/models/clusters/concerns/application_status.rb | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/app/models/clusters/applications/jupyter.rb b/app/models/clusters/applications/jupyter.rb index 7be6a14f585..e43a0fd1786 100644 --- a/app/models/clusters/applications/jupyter.rb +++ b/app/models/clusters/applications/jupyter.rb @@ -19,7 +19,7 @@ module Clusters def set_initial_status return unless not_installable? - if cluster&.application_ingress_installed? && cluster.application_ingress.external_ip + if cluster&.application_ingress_available? && cluster.application_ingress.external_ip self.status = 'installable' end end diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index d7011ef447a..20d53b8e620 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -43,8 +43,9 @@ module Clusters delegate :active?, to: :platform_kubernetes, prefix: true, allow_nil: true delegate :rbac?, to: :platform_kubernetes, prefix: true, allow_nil: true - delegate :installed?, to: :application_helm, prefix: true, allow_nil: true - delegate :installed?, to: :application_ingress, prefix: true, allow_nil: true + delegate :available?, to: :application_helm, prefix: true, allow_nil: true + delegate :available?, to: :application_ingress, prefix: true, allow_nil: true + delegate :available?, to: :application_prometheus, prefix: true, allow_nil: true enum platform_type: { kubernetes: 1 diff --git a/app/models/clusters/concerns/application_core.rb b/app/models/clusters/concerns/application_core.rb index e3deedfb036..683b45331f6 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 = 'installable' if cluster&.application_helm_installed? + self.status = 'installable' if cluster&.application_helm_available? end def self.application_name diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb index a9df59fc059..93bdf9c223d 100644 --- a/app/models/clusters/concerns/application_status.rb +++ b/app/models/clusters/concerns/application_status.rb @@ -66,6 +66,10 @@ module Clusters end end end + + def available? + installed? || updated? + end end end end |