diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 12:07:22 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-11-07 12:10:57 +0300 |
commit | 3bf2abaa1cc26b8658d870e85d4fc9e60e621944 (patch) | |
tree | 95df4b629e497dae1c76a53c1d0eb9a2d8d79b52 /app/models/clusters/concerns | |
parent | f9364929bacf9ed68e32bb50758e24715d404069 (diff) |
More restrictive state machine transitions in Clusters::ApplicationStatus
Diffstat (limited to 'app/models/clusters/concerns')
-rw-r--r-- | app/models/clusters/concerns/application_status.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/clusters/concerns/application_status.rb b/app/models/clusters/concerns/application_status.rb index 40140cb71cb..e73abfa9055 100644 --- a/app/models/clusters/concerns/application_status.rb +++ b/app/models/clusters/concerns/application_status.rb @@ -12,20 +12,20 @@ module Clusters state :installing, value: 2 state :installed, value: 3 + event :make_scheduled do + transition %i(installable errored) => :scheduled + end + event :make_installing do - transition any - [:installing] => :installing + transition %i(scheduled) => :installing end event :make_installed do - transition any - [:installed] => :installed + transition %i(installing) => :installed end event :make_errored do - transition any - [:errored] => :errored - end - - event :make_scheduled do - transition %i(installable errored) => :scheduled + transition any => :errored end before_transition any => [:scheduled] do |app_status, _| |