mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 15:05:20 +00:00
Sort revisions in rollout history as integers
Previously keys were sorted as strings, thus it was possible to see such order as 1, 10, 2, 3, 4, 5. Ints64 helper implemented in util/slice module to sort []int64
This commit is contained in:
@@ -68,3 +68,12 @@ func TestShuffleStrings(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortInts64(t *testing.T) {
|
||||
src := []int64{10, 1, 2, 3, 4, 5, 6}
|
||||
expected := []int64{1, 2, 3, 4, 5, 6, 10}
|
||||
SortInts64(src)
|
||||
if !reflect.DeepEqual(src, expected) {
|
||||
t.Errorf("func Ints64 didnt sort correctly, %v !- %v", src, expected)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user