mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #435 from Liujingfang1/flakytest
fix the flaky test in crd package
This commit is contained in:
@@ -18,6 +18,7 @@ package crds
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"sort"
|
||||
"testing"
|
||||
|
||||
"sigs.k8s.io/kustomize/pkg/gvk"
|
||||
@@ -181,6 +182,14 @@ func TestRegisterCRD(t *testing.T) {
|
||||
|
||||
pathconfig, _ := registerCRD(ldr, "/testpath/crd.json")
|
||||
|
||||
sort.Slice(expected.NameReference[:], func(i, j int) bool {
|
||||
return expected.NameReference[i].Gvk.String() < expected.NameReference[j].Gvk.String()
|
||||
})
|
||||
|
||||
sort.Slice(pathconfig.NameReference[:], func(i, j int) bool {
|
||||
return pathconfig.NameReference[i].Gvk.String() < pathconfig.NameReference[j].Gvk.String()
|
||||
})
|
||||
|
||||
if !reflect.DeepEqual(pathconfig, expected) {
|
||||
t.Fatalf("expected\n %v\n but got\n %v\n", expected, pathconfig)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user