Commit 109b4b1d authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'fix-cluster-apps-error-transitions' into 'master'

Clean status_reason on make_externally_ cluster apps transitions

See merge request gitlab-org/gitlab!36913
parents 3b74c341 391e819d
...@@ -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