mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
sort by PriorityLevel Configuration name when dumping priority levels
This commit is contained in:
parent
3edbebe348
commit
20b5308c6c
@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
@ -59,7 +60,19 @@ func (cfgCtlr *configController) dumpPriorityLevels(w http.ResponseWriter, r *ht
|
||||
}
|
||||
tabPrint(tabWriter, rowForHeaders(columnHeaders))
|
||||
endLine(tabWriter)
|
||||
for _, plState := range cfgCtlr.priorityLevelStates {
|
||||
plNames := make([]string, len(cfgCtlr.priorityLevelStates))
|
||||
i := 0
|
||||
for plName := range cfgCtlr.priorityLevelStates {
|
||||
plNames[i] = plName
|
||||
i++
|
||||
}
|
||||
sort.Strings(plNames)
|
||||
for i := range plNames {
|
||||
plState, ok := cfgCtlr.priorityLevelStates[plNames[i]]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
|
||||
if plState.queues == nil {
|
||||
tabPrint(tabWriter, row(
|
||||
plState.pl.Name, // 1
|
||||
|
Loading…
Reference in New Issue
Block a user