Commit 42f4481d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'canaries-first' into 'master'

Show canaries first

Closes #2216

See merge request !1685
parents 17e57b8b dd568462
...@@ -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