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
transition [:scheduled] => :uninstalling
end
before_transition any => [:scheduled] do |application, _|
before_transition any => [:scheduled, :installed, :uninstalled] do |application, _|
application.status_reason = nil
end
......
......@@ -262,6 +262,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
expect(subject).to be_installed
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
......@@ -292,6 +300,14 @@ RSpec.shared_examples 'cluster application status specs' do |application_name|
expect(subject).to be_uninstalled
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
......
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