mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: cluster health exit with non-zero when cluster is unhealthy
This commit is contained in:
parent
09b81bad15
commit
fc61fc7c7a
@ -108,8 +108,13 @@ func handleClusterHealth(c *cli.Context) {
|
||||
}
|
||||
|
||||
if !forever {
|
||||
break
|
||||
if health {
|
||||
os.Exit(ExitSuccess)
|
||||
} else {
|
||||
os.Exit(ExitClusterNotHealthy)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Printf("\nnext check after 10 second...\n\n")
|
||||
time.Sleep(10 * time.Second)
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ const (
|
||||
ExitBadConnection
|
||||
ExitBadAuth
|
||||
ExitServerError
|
||||
ExitClusterNotHealthy
|
||||
)
|
||||
|
||||
func handleError(code int, err error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user