@@ -21,7 +21,7 @@ import (
2121 "errors"
2222 "fmt"
2323 "reflect"
24- "sort "
24+ "slices "
2525 "strconv"
2626 "strings"
2727 "time"
@@ -808,8 +808,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
808808
809809 By ("verifying the pointer fields in pod have the same addresses" )
810810 Expect (outList1 .Items ).To (HaveLen (len (outList2 .Items )))
811- sort . SliceStable (outList1 .Items , func (i , j int ) bool { return outList1 . Items [ i ] .Name <= outList1 . Items [ j ] .Name })
812- sort . SliceStable (outList2 .Items , func (i , j int ) bool { return outList2 . Items [ i ] .Name <= outList2 . Items [ j ] .Name })
811+ slices . SortStableFunc (outList1 .Items , func (i , j corev1. Pod ) int { return strings . Compare ( i .Name , j .Name ) })
812+ slices . SortStableFunc (outList2 .Items , func (i , j corev1. Pod ) int { return strings . Compare ( i .Name , j .Name ) })
813813 for i := range outList1 .Items {
814814 a := & outList1 .Items [i ]
815815 b := & outList2 .Items [i ]
@@ -1134,8 +1134,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
11341134
11351135 By ("verifying the pointer fields in pod have the same addresses" )
11361136 Expect (outList1 .Items ).To (HaveLen (len (outList2 .Items )))
1137- sort . SliceStable (outList1 .Items , func (i , j int ) bool { return outList1 . Items [ i ] .GetName () <= outList1 . Items [ j ] .GetName () })
1138- sort . SliceStable (outList2 .Items , func (i , j int ) bool { return outList2 . Items [ i ] .GetName () <= outList2 . Items [ j ] .GetName () })
1137+ slices . SortStableFunc (outList1 .Items , func (i , j unstructured. Unstructured ) int { return strings . Compare ( i .GetName (), j .GetName () ) })
1138+ slices . SortStableFunc (outList2 .Items , func (i , j unstructured. Unstructured ) int { return strings . Compare ( i .GetName (), j .GetName () ) })
11391139 for i := range outList1 .Items {
11401140 a := & outList1 .Items [i ]
11411141 b := & outList2 .Items [i ]
@@ -1519,8 +1519,8 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca
15191519
15201520 By ("verifying the pointer fields in pod have the same addresses" )
15211521 Expect (outList1 .Items ).To (HaveLen (len (outList2 .Items )))
1522- sort . SliceStable (outList1 .Items , func (i , j int ) bool { return outList1 . Items [ i ] .Name <= outList1 . Items [ j ] .Name })
1523- sort . SliceStable (outList2 .Items , func (i , j int ) bool { return outList2 . Items [ i ] .Name <= outList2 . Items [ j ] .Name })
1522+ slices . SortStableFunc (outList1 .Items , func (i , j metav1. PartialObjectMetadata ) int { return strings . Compare ( i .Name , j .Name ) })
1523+ slices . SortStableFunc (outList2 .Items , func (i , j metav1. PartialObjectMetadata ) int { return strings . Compare ( i .Name , j .Name ) })
15241524 for i := range outList1 .Items {
15251525 a := & outList1 .Items [i ]
15261526 b := & outList2 .Items [i ]
0 commit comments