Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jibel committed Oct 30, 2023
1 parent 2236d73 commit 30b66d9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions e2e/internal/az/image.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package az

import (
"cmp"
"context"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -72,10 +73,8 @@ func (images Images) LatestDaily() (Image, error) {

// Reverse sort images by version
slices.SortFunc(dailyImages, func(i, j Image) int {
if natural.Less(i.Version, j.Version) {
return -1
}
return 1
// Version format is: 23.04.20231029
return cmp.Compare(j.Version, i.Version)
})

return dailyImages[0], nil
Expand All @@ -97,10 +96,8 @@ func (images Images) LatestStable() (Image, error) {

// Reverse sort images by version
slices.SortFunc(stableImages, func(i, j Image) int {
if natural.Less(i.Version, j.Version) {
return -1
}
return 1
// Version format is: 23.04.20231029
return cmp.Compare(j.Version, i.Version)
})

return stableImages[0], nil
Expand Down

0 comments on commit 30b66d9

Please sign in to comment.