forked from TrueCloudLab/frostfs-node
[#333] Sort shards by shard_ID in cli output
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
3889e829e6
commit
d9b93b12c1
2 changed files with 18 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
|||
package control
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
rawclient "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
|
||||
|
@ -167,5 +169,9 @@ func getShardIDList(cmd *cobra.Command) [][]byte {
|
|||
res = append(res, raw)
|
||||
}
|
||||
|
||||
sort.Slice(res, func(i, j int) bool {
|
||||
return bytes.Compare(res[i], res[j]) < 0
|
||||
})
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue