diff --git a/pkg/crd/gen.go b/pkg/crd/gen.go index 4385a5fe6..f05002104 100644 --- a/pkg/crd/gen.go +++ b/pkg/crd/gen.go @@ -19,6 +19,7 @@ package crd import ( "fmt" "go/types" + "sort" apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextlegacy "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" @@ -260,5 +261,9 @@ func FindKubeKinds(parser *Parser, metav1Pkg *loader.Package) []schema.GroupKind kubeKinds = append(kubeKinds, groupKind) } + sort.Slice(kubeKinds, func(i, j int) bool { + return kubeKinds[i].String() < kubeKinds[j].String() + }) + return kubeKinds }