sort the aggregatedStatus in rb/crb by the clusterName
Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
parent
cd05ffee6e
commit
86072e1dbd
|
@ -5,6 +5,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -193,6 +194,9 @@ func assembleWorkStatus(works []workv1alpha1.Work, workload *unstructured.Unstru
|
|||
}
|
||||
}
|
||||
|
||||
sort.Slice(statuses, func(i, j int) bool {
|
||||
return statuses[i].ClusterName < statuses[j].ClusterName
|
||||
})
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue