Commit dd568462 authored by Kamil Trzcinski's avatar Kamil Trzcinski Committed by Sean McGivern

Show canaries first

parent 5d5d3d1c
...@@ -21,6 +21,10 @@ module Gitlab ...@@ -21,6 +21,10 @@ module Gitlab
track == 'stable' track == 'stable'
end end
def order
stable? ? 1 : 0
end
def outdated? def outdated?
observed_generation < generation observed_generation < generation
end end
......
...@@ -20,6 +20,7 @@ module Gitlab ...@@ -20,6 +20,7 @@ module Gitlab
return new([], valid: false) if specs.empty? return new([], valid: false) if specs.empty?
deployments = specs.map { |spec| ::Gitlab::Kubernetes::Deployment.new(spec) } deployments = specs.map { |spec| ::Gitlab::Kubernetes::Deployment.new(spec) }
deployments.sort_by!(&:order)
new(deployments) new(deployments)
end end
......
...@@ -53,12 +53,12 @@ describe Gitlab::Kubernetes::RolloutStatus do ...@@ -53,12 +53,12 @@ describe Gitlab::Kubernetes::RolloutStatus do
it 'stores the union of deployment instances' do it 'stores the union of deployment instances' do
expected = [ expected = [
{ status: 'finished', tooltip: 'one (pod 0) Finished', track: 'stable', stable: true },
{ status: 'finished', tooltip: 'one (pod 1) Finished', track: 'stable', stable: true },
{ status: 'finished', tooltip: 'one (pod 2) Finished', track: 'stable', stable: true },
{ status: 'finished', tooltip: 'two (pod 0) Finished', track: 'canary', stable: false }, { status: 'finished', tooltip: 'two (pod 0) Finished', track: 'canary', stable: false },
{ status: 'finished', tooltip: 'two (pod 1) Finished', track: 'canary', stable: false }, { status: 'finished', tooltip: 'two (pod 1) Finished', track: 'canary', stable: false },
{ status: 'finished', tooltip: 'two (pod 2) Finished', track: 'canary', stable: false }, { status: 'finished', tooltip: 'two (pod 2) Finished', track: 'canary', stable: false },
{ status: 'finished', tooltip: 'one (pod 0) Finished', track: 'stable', stable: true },
{ status: 'finished', tooltip: 'one (pod 1) Finished', track: 'stable', stable: true },
{ status: 'finished', tooltip: 'one (pod 2) Finished', track: 'stable', stable: true },
] ]
expect(rollout_status.instances).to eq(expected) expect(rollout_status.instances).to eq(expected)
......
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