File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ package crds
18
18
19
19
import (
20
20
"reflect"
21
+ "sort"
21
22
"testing"
22
23
23
24
"sigs.k8s.io/kustomize/pkg/gvk"
@@ -181,6 +182,14 @@ func TestRegisterCRD(t *testing.T) {
181
182
182
183
pathconfig , _ := registerCRD (ldr , "/testpath/crd.json" )
183
184
185
+ sort .Slice (expected .NameReference [:], func (i , j int ) bool {
186
+ return expected .NameReference [i ].Gvk .String () < expected .NameReference [j ].Gvk .String ()
187
+ })
188
+
189
+ sort .Slice (pathconfig .NameReference [:], func (i , j int ) bool {
190
+ return pathconfig .NameReference [i ].Gvk .String () < pathconfig .NameReference [j ].Gvk .String ()
191
+ })
192
+
184
193
if ! reflect .DeepEqual (pathconfig , expected ) {
185
194
t .Fatalf ("expected\n %v\n but got\n %v\n " , expected , pathconfig )
186
195
}
You can’t perform that action at this time.
0 commit comments