mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
satisfy linter
This commit is contained in:
@@ -113,8 +113,8 @@ func NodeShow(conf *cfg.Config, nodename string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
k8snode := info.Attributes["k8s_node_name"]
|
k8snode := info.Attributes["k8s_node_name"]
|
||||||
|
|
||||||
rank := "none"
|
rank := "none"
|
||||||
|
|
||||||
adsel, exists := stat.AdaptiveSelection[id]
|
adsel, exists := stat.AdaptiveSelection[id]
|
||||||
if exists {
|
if exists {
|
||||||
rank = *adsel.Rank
|
rank = *adsel.Rank
|
||||||
|
|||||||
@@ -163,16 +163,9 @@ func ShardAllocation(conf *cfg.Config, index string) error {
|
|||||||
|
|
||||||
slog.Debug("ES result", "explain", res)
|
slog.Debug("ES result", "explain", res)
|
||||||
|
|
||||||
currentNode := res.CurrentNode
|
|
||||||
|
|
||||||
table := printer.NewTable(conf, 2, 10)
|
table := printer.NewTable(conf, 2, 10)
|
||||||
table.Addheaders("shard allocation setting", "value")
|
table.Addheaders("shard allocation setting", "value")
|
||||||
|
|
||||||
roles := make([]string, len(currentNode.Roles))
|
|
||||||
for idx, role := range currentNode.Roles {
|
|
||||||
roles[idx] = role.Name
|
|
||||||
}
|
|
||||||
|
|
||||||
table.Entries = [][]any{
|
table.Entries = [][]any{
|
||||||
{"Index", index},
|
{"Index", index},
|
||||||
{"Current state", res.CurrentState},
|
{"Current state", res.CurrentState},
|
||||||
@@ -181,7 +174,14 @@ func ShardAllocation(conf *cfg.Config, index string) error {
|
|||||||
{"Can remain on current node", res.CanRemainOnCurrentNode.Name},
|
{"Can remain on current node", res.CanRemainOnCurrentNode.Name},
|
||||||
}
|
}
|
||||||
|
|
||||||
if currentNode != nil {
|
if res.CurrentNode != nil {
|
||||||
|
currentNode := res.CurrentNode
|
||||||
|
roles := make([]string, len(currentNode.Roles))
|
||||||
|
|
||||||
|
for idx, role := range currentNode.Roles {
|
||||||
|
roles[idx] = role.Name
|
||||||
|
}
|
||||||
|
|
||||||
table.Entries = append(table.Entries, [][]any{
|
table.Entries = append(table.Entries, [][]any{
|
||||||
{"Current node", currentNode.Name},
|
{"Current node", currentNode.Name},
|
||||||
{"Current k8s node", currentNode.Attributes["k8s_node_name"]},
|
{"Current k8s node", currentNode.Attributes["k8s_node_name"]},
|
||||||
|
|||||||
Reference in New Issue
Block a user