Add CI pipelines, fix linting issues (#12)

This commit is contained in:
T. von Dein
2026-05-07 15:01:18 +02:00
parent 5e82a3706b
commit 38ed9de0b4
14 changed files with 257 additions and 97 deletions

View File

@@ -78,7 +78,7 @@ func ClusterCompare(conf *cfg.Config, leader, follower string) error {
}
if !checkClusterStatus(conf, leader, follower) {
return errors.New("One of the two clusters is in a failed state")
return errors.New("one of the two clusters is in a failed state")
}
findIlmErrors(conf, leader, follower)
@@ -115,7 +115,9 @@ func ClusterList(conf *cfg.Config) error {
}
table.Sort()
table.PrintMarkdown()
if err := table.PrintMarkdown(); err != nil {
return err
}
return nil
}
@@ -126,7 +128,7 @@ func ClusterStatus(conf *cfg.Config) error {
clusters := []string{}
if conf.All {
for key, _ := range conf.Clusters {
for key := range conf.Clusters {
clusters = append(clusters, key)
}
} else {
@@ -186,8 +188,8 @@ func ClusterStatus(conf *cfg.Config) error {
table.Addheaders(cluster, "status")
table.entries = [][]string{
{"Cluster Name", Colorize(*&clusterhealth.Status.Name, clusterhealth.ClusterName)},
{"ES Version", fmt.Sprintf("%s", info.Version.Int)},
{"Cluster Name", Colorize(clusterhealth.Status.Name, clusterhealth.ClusterName)},
{"ES Version", info.Version.Int},
{"Active Shards", fmt.Sprintf("%d", clusterhealth.ActiveShards)},
{"Active Primary Shards", fmt.Sprintf("%d", clusterhealth.ActivePrimaryShards)},
{"Indicies", fmt.Sprintf("%d", len(clusterhealth.Indices))},
@@ -195,7 +197,9 @@ func ClusterStatus(conf *cfg.Config) error {
{"AutoFollow (success/failed indices)", ccrfollowing},
}
table.PrintMarkdown()
if err := table.PrintMarkdown(); err != nil {
return err
}
}
return nil
@@ -244,9 +248,11 @@ func ClusterSettingsList(conf *cfg.Config) error {
}
table.entries = entries
table.Sort()
table.PrintMarkdown()
if err := table.PrintMarkdown(); err != nil {
return err
}
return nil
}