further table streamlining: work with new table api everywhere

This commit is contained in:
2026-08-09 21:48:03 +02:00
parent b49153bd38
commit 2841a94fe5
27 changed files with 271 additions and 249 deletions

View File

@@ -71,9 +71,9 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool {
status[cluster] = clusterHealth
}
table := printer.NewTable(conf).WithSize(3, 6)
table := printer.NewTable(conf).WithSize(3, 6).
table.Addheaders("setting", "leader:"+leader, "follower:"+follower)
WithHeaders("setting", "leader:"+leader, "follower:"+follower)
table.Entries = [][]any{
{"Cluster Name", status[leader].ClusterName, status[follower].ClusterName},
@@ -151,8 +151,8 @@ func findIlmErrors(conf *cfg.Config, leader, follower string) bool {
if len(failed[cluster]) > 0 {
idx := 0
table := printer.NewTable(conf).WithSize(2, len(failed[cluster]))
table.Addheaders("ilm errors on "+which, "errors")
table := printer.NewTable(conf).WithSize(2, len(failed[cluster])).
WithHeaders("ilm errors on "+which, "errors")
for name, count := range failed[cluster] {
table.Entries[idx] = []any{name, count}
@@ -225,8 +225,8 @@ func findIndicesOnlyOnLeader(conf *cfg.Config, indices ClusterIndices, leader, f
}
idx := 0
table := printer.NewTable(conf).WithSize(3, len(indexOnlyOnLeader))
table.Addheaders("index only on leader", "size", "docscount")
table := printer.NewTable(conf).WithSize(3, len(indexOnlyOnLeader)).
WithHeaders("index only on leader", "size", "docscount")
for name, index := range indexOnlyOnLeader {
name := printer.Colorize(conf, "red", name)
@@ -275,8 +275,8 @@ func findOrphanedIndices(conf *cfg.Config, indices ClusterIndices, leader, follo
}
idx := 0
table := printer.NewTable(conf).WithSize(3, len(orphaned))
table.Addheaders("orphaned index on follower", "size", "docscount")
table := printer.NewTable(conf).WithSize(3, len(orphaned)).
WithHeaders("orphaned index on follower", "size", "docscount")
for name, index := range orphaned {
name := printer.Colorize(conf, "red", name)
@@ -311,8 +311,8 @@ func findFailedFollowerIndices(conf *cfg.Config, indices ClusterIndices, followe
}
idx := 0
table := printer.NewTable(conf).WithSize(3, len(red))
table.Addheaders("red index on follower", "size", "docscount")
table := printer.NewTable(conf).WithSize(3, len(red)).
WithHeaders("red index on follower", "size", "docscount")
for name, index := range red {
name := printer.Colorize(conf, "red", name)