summaryrefslogtreecommitdiff
path: root/app/models/clusters/concerns/application_status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/clusters/concerns/application_status.rb')
-rw-r--r--app/models/clusters/concerns/application_status.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb
index a556dd5ad8b..6fe7b4a6bd7 100644
--- a/app/models/clusters/concerns/application_status.rb
+++ b/app/models/clusters/concerns/application_status.rb
@@ -20,7 +20,7 @@ module Clusters
state :update_errored, value: 6
event :make_scheduled do
- transition [:installable, :errored] => :scheduled
+ transition [:installable, :errored, :installed, :updated, :update_errored] => :scheduled
end
event :make_installing do
@@ -29,16 +29,19 @@ module Clusters
event :make_installed do
transition [:installing] => :installed
+ transition [:updating] => :updated
end
event :make_errored do
- transition any => :errored
+ transition any - [:updating] => :errored
+ transition [:updating] => :update_errored
end
event :make_updating do
- transition [:installed, :updated, :update_errored] => :updating
+ transition [:installed, :updated, :update_errored, :scheduled] => :updating
end
+ # Deprecated
event :make_updated do
transition [:updating] => :updated
end
@@ -74,6 +77,10 @@ module Clusters
end
end
+ def updateable?
+ installed? || updated? || update_errored?
+ end
+
def available?
installed? || updated?
end