From 36518f62686110dec836e0beb62cab58324a37d0 Mon Sep 17 00:00:00 2001 From: Ghasem Shirazi Date: Fri, 20 May 2022 07:40:10 -0700 Subject: [PATCH] crd/gen: sort FindKubeKinds --- pkg/crd/gen.go | 5 +++++ 1 file changed, 5 insertions(+) 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 }