Skip to content

Commit

Permalink
Fix kdmimages test failed
Browse files Browse the repository at this point in the history
  • Loading branch information
STARRY-S committed Apr 12, 2024
1 parent ba52262 commit b541887
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/rancher/kdmimages/kdmimages_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kdmimages

import (
"sort"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit b541887

Please sign in to comment.