Skip to content

Commit

Permalink
Container build: sort instances in SQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Jan 6, 2020
1 parent 0ce2c6b commit ccdd285
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/helpers/container_build_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def textual_group_build_instances
end

def collect_build_pods
builds = @record.container_build_pods.collect do |build_pod|
@record.container_build_pods
.order('completion_timestamp desc')
.collect do |build_pod|
[
build_pod.name,
build_pod.phase,
Expand All @@ -47,7 +49,6 @@ def collect_build_pods
parse_duration(build_pod.duration),
]
end
builds.sort! { |a, b| Time.parse(b[7] || Time.current.to_s).to_i <=> Time.parse(a[7] || Time.current.to_s).to_i }
end

#
Expand Down

0 comments on commit ccdd285

Please sign in to comment.