Update version column after application is updated
Note: updating version column after :updating is not ideal in the updating -> update_erroed case. This will mean that the application now records the version as the version that failed to upgrade, not the version that it is currently on.
This commit is contained in:
parent
bc5a2ed8c6
commit
8ef1128f67
2 changed files with 14 additions and 0 deletions
|
@ -10,6 +10,10 @@ module Clusters
|
||||||
after_transition any => [:installing] do |application|
|
after_transition any => [:installing] do |application|
|
||||||
application.update(version: application.class.const_get(:VERSION))
|
application.update(version: application.class.const_get(:VERSION))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before_transition any => :updated do |application|
|
||||||
|
application.version = application.class.const_get(:VERSION)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -78,6 +78,16 @@ shared_examples 'cluster application status specs' do |application_name|
|
||||||
|
|
||||||
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
expect(subject.cluster.application_helm.version).to eq(Gitlab::Kubernetes::Helm::HELM_VERSION)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'updates the version for the application' do
|
||||||
|
subject.update!(version: '0.0.0')
|
||||||
|
|
||||||
|
subject.make_updated!
|
||||||
|
|
||||||
|
subject.reload
|
||||||
|
|
||||||
|
expect(subject.version).to eq(subject.class.const_get(:VERSION))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#make_errored' do
|
describe '#make_errored' do
|
||||||
|
|
Loading…
Reference in a new issue