From 30b66d9ec6b0cae3a1b1fec22e0a9a42ae4b2946 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lallement Date: Mon, 30 Oct 2023 18:32:23 +0200 Subject: [PATCH] Addressing comments --- e2e/internal/az/image.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/e2e/internal/az/image.go b/e2e/internal/az/image.go index 32c4ad224..8b5325dc6 100644 --- a/e2e/internal/az/image.go +++ b/e2e/internal/az/image.go @@ -1,6 +1,7 @@ package az import ( + "cmp" "context" "encoding/json" "fmt" @@ -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 @@ -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