From 9d38ea6ffcfa028499087c2c01da3d84fc6d71a4 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 23 Dec 2022 11:44:28 +0200 Subject: [PATCH] check: Show the latest stored version of CRDs Signed-off-by: Stefan Prodan --- cmd/flux/check.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/flux/check.go b/cmd/flux/check.go index cf43654a..1aa0a44e 100644 --- a/cmd/flux/check.go +++ b/cmd/flux/check.go @@ -242,8 +242,9 @@ func crdsCheck() bool { } for _, crd := range list.Items { - if len(crd.Status.StoredVersions) > 0 { - logger.Successf(crd.Name + "/" + crd.Status.StoredVersions[0]) + versions := crd.Status.StoredVersions + if len(versions) > 0 { + logger.Successf(crd.Name + "/" + versions[len(versions)-1]) } else { ok = false logger.Failuref("no stored versions for %s", crd.Name)