mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +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"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"text/tabwriter"
|
"text/tabwriter"
|
||||||
@ -59,7 +60,19 @@ func (cfgCtlr *configController) dumpPriorityLevels(w http.ResponseWriter, r *ht
|
|||||||
}
|
}
|
||||||
tabPrint(tabWriter, rowForHeaders(columnHeaders))
|
tabPrint(tabWriter, rowForHeaders(columnHeaders))
|
||||||
endLine(tabWriter)
|
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 {
|
if plState.queues == nil {
|
||||||
tabPrint(tabWriter, row(
|
tabPrint(tabWriter, row(
|
||||||
plState.pl.Name, // 1
|
plState.pl.Name, // 1
|
||||||
|
Loading…
Reference in New Issue
Block a user