From 4519f6cd2d92c91a7bb3adb312bbd139949257bb Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 27 Mar 2024 16:52:34 +0800 Subject: [PATCH] fix(obcluster): sort results of listing obcluster --- internal/dashboard/business/oceanbase/obcluster.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/dashboard/business/oceanbase/obcluster.go b/internal/dashboard/business/oceanbase/obcluster.go index acb2fb8e9..e8abf9b33 100644 --- a/internal/dashboard/business/oceanbase/obcluster.go +++ b/internal/dashboard/business/oceanbase/obcluster.go @@ -280,6 +280,9 @@ func ListOBClusters(ctx context.Context) ([]response.OBClusterOverview, error) { if err != nil { return obclusters, errors.Wrap(err, "failed to list obclusters") } + sort.Slice(obclusterList.Items, func(i, j int) bool { + return obclusterList.Items[i].Name < obclusterList.Items[j].Name + }) for _, obcluster := range obclusterList.Items { resp, err := buildOBClusterOverview(ctx, &obcluster) if err != nil {