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

@@ -85,8 +85,8 @@ func IlmList(conf *cfg.Config, pattern string) error {
repr.Println(res)
}
table := printer.NewTable(conf).WithSize(5, 0)
table.Addheaders("ilm policy", "hot", "warm", "frozen", "delete")
table := printer.NewTable(conf).WithSize(5, 0).
WithHeaders("ilm policy", "hot", "warm", "frozen", "delete")
for name, ilm := range res {
table.AddRow(name,
@@ -123,8 +123,8 @@ func IlmShow(conf *cfg.Config, policy string) error {
return IlmShowTree(conf, ilm.Policy)
}
table := printer.NewTable(conf).WithSize(2, 5)
table.Addheaders("ilm policy setting", "value")
table := printer.NewTable(conf).WithSize(2, 5).
WithHeaders("ilm policy setting", "value")
table.Entries = [][]any{
{"policy", policy},
@@ -142,9 +142,6 @@ func IlmShow(conf *cfg.Config, policy string) error {
func IlmShowTree(conf *cfg.Config, ilm types.IlmPolicy) error {
indent := ""
table := printer.NewTable(conf).WithSize(4, 0)
table.Addheaders("phase", "min age", "min size", "snapshot repo")
for _, phase := range IlmPhaseOrder {
if phase == "hot" {
fmt.Printf("%s%s phase:\n%s rollover after %s\n",
@@ -280,8 +277,8 @@ func IlmExplain(conf *cfg.Config, index string) error {
ilm := explain.(*types.LifecycleExplainManaged)
table := printer.NewTable(conf).WithSize(2, 0)
table.Addheaders("ilm status field", "value")
table := printer.NewTable(conf).WithSize(2, 0).
WithHeaders("ilm status field", "value")
info := ""