mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:44:17 +02:00
also fix color status in ccr status
This commit is contained in:
@@ -25,7 +25,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"codeberg.org/scip/esctl/pkg/cfg"
|
||||
"codeberg.org/scip/esctl/pkg/printer"
|
||||
"codeberg.org/scip/esctl/pkg/printer"
|
||||
"github.com/elastic/go-elasticsearch/v9"
|
||||
"github.com/elastic/go-elasticsearch/v9/typedapi/cluster/health"
|
||||
"github.com/elastic/go-elasticsearch/v9/typedapi/types"
|
||||
@@ -75,14 +75,15 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool {
|
||||
status[cluster] = st
|
||||
}
|
||||
|
||||
table := printer.NewTable(conf, 3, 5)
|
||||
table := printer.NewTable(conf, 3, 6)
|
||||
|
||||
table.Addheaders("setting", "leader:"+leader, "follower:"+follower)
|
||||
|
||||
table.Entries = [][]string{
|
||||
{"Cluster Name",
|
||||
printer.Colorize(conf, status[leader].Status.Name, status[leader].ClusterName),
|
||||
printer.Colorize(conf, status[follower].Status.Name, status[follower].ClusterName),
|
||||
{"Cluster Name", status[leader].ClusterName, status[follower].ClusterName},
|
||||
{"Cluster Status",
|
||||
printer.Colorize(conf, status[leader].Status.Name, status[leader].Status.Name),
|
||||
printer.Colorize(conf, status[follower].Status.Name, status[follower].Status.Name),
|
||||
},
|
||||
{"Active Shards",
|
||||
fmt.Sprintf("%d", status[leader].ActiveShards),
|
||||
@@ -107,6 +108,8 @@ func checkClusterStatus(conf *cfg.Config, leader, follower string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
|
||||
if status[leader].Status.Name == "green" && status[follower].Status.Name == "green" {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user