Commit 391e819d authored by ap4y's avatar ap4y

Clean status_reason on make_externally_ cluster apps transitions

Recently added artifact parsing added 2 new transitions. This MR adds
a status_reason cleanup for this transitions to prevent ambigious
states.
parent 7d14e142
...@@ -79,7 +79,7 @@ module Clusters ...@@ -79,7 +79,7 @@ module Clusters
transition [:scheduled] => :uninstalling transition [:scheduled] => :uninstalling
end end
before_transition any => [:scheduled] do |application, _| before_transition any => [:scheduled, :installed, :uninstalled] do |application, _|
application.status_reason = nil application.status_reason = nil
end end
......
...@@ -262,6 +262,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| ...@@ -262,6 +262,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
expect(subject).to be_installed expect(subject).to be_installed
end end
it 'clears #status_reason' do
expect(subject.status_reason).not_to be_nil
subject.make_externally_installed!
expect(subject.status_reason).to be_nil
end
end end
end end
...@@ -292,6 +300,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| ...@@ -292,6 +300,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
expect(subject).to be_uninstalled expect(subject).to be_uninstalled
end end
it 'clears #status_reason' do
expect(subject.status_reason).not_to be_nil
subject.make_externally_uninstalled!
expect(subject.status_reason).to be_nil
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment