From cca9f791faa5770e3467486372e6be7bb648c926 Mon Sep 17 00:00:00 2001 From: John Starich Date: Wed, 16 Mar 2022 16:29:56 -0500 Subject: [PATCH] Fix latest version for genolm Signed-off-by: John Starich --- internal/cmd/genolm/crd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cmd/genolm/crd.go b/internal/cmd/genolm/crd.go index aabd870d..0afc15eb 100644 --- a/internal/cmd/genolm/crd.go +++ b/internal/cmd/genolm/crd.go @@ -92,7 +92,7 @@ func NewCRD(src apiextensionsv1.CustomResourceDefinition, ownedResources []TypeM panic(fmt.Sprintf("Versions section is empty: %#v", src.Spec)) } - latestVersion := src.Spec.Versions[len(src.Spec.Versions)-1] + latestVersion := src.Spec.Versions[0] return CRD{ DisplayName: src.Spec.Names.Kind, Description: latestVersion.Schema.OpenAPIV3Schema.Description,