From b541887894bc4816646513df73f238128aadf407 Mon Sep 17 00:00:00 2001 From: StarryWang Date: Fri, 12 Apr 2024 10:41:11 +0800 Subject: [PATCH] Fix kdmimages test failed --- pkg/rancher/kdmimages/kdmimages_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/rancher/kdmimages/kdmimages_test.go b/pkg/rancher/kdmimages/kdmimages_test.go index 8d21cd8..d448b80 100644 --- a/pkg/rancher/kdmimages/kdmimages_test.go +++ b/pkg/rancher/kdmimages/kdmimages_test.go @@ -1,6 +1,7 @@ package kdmimages import ( + "sort" "testing" "github.com/stretchr/testify/assert" @@ -13,6 +14,7 @@ func Test_filterDeprecatedVersions(t *testing.T) { "v1.21.2", } v := filterDeprecatedVersions(testVersions) + sort.Strings(v) if !assert.Equal(t, []string{"v1.21.2"}, v) { return } @@ -28,12 +30,14 @@ func Test_filterDeprecatedVersions(t *testing.T) { "v1.28.3", } v = filterDeprecatedVersions(testVersions) + sort.Strings(v) if !assert.Equal(t, []string{"v1.21.2", "v1.22.2", "v1.28.3"}, v) { return } t.Logf("filterDeprecatedVersions: %v", v) v = filterDeprecatedVersions([]string{}) + sort.Strings(v) if !assert.Equal(t, []string{}, v) { return }