mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #24323 from avsm/better-leave-grammar
Improve the warning messages when leaving a Swarm cluster
This commit is contained in:
commit
c70e432cee
1 changed files with 3 additions and 3 deletions
|
@ -412,18 +412,18 @@ func (c *Cluster) Leave(force bool) error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if active && reachable-2 <= unreachable {
|
if active && reachable-2 <= unreachable {
|
||||||
if reachable == 1 && unreachable == 0 {
|
if reachable == 1 && unreachable == 0 {
|
||||||
msg += "Leaving last manager will remove all current state of the cluster. Use `--force` to ignore this message. "
|
msg += "Removing the last manager will erase all current state of the cluster. Use `--force` to ignore this message. "
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
return fmt.Errorf(msg)
|
return fmt.Errorf(msg)
|
||||||
}
|
}
|
||||||
msg += fmt.Sprintf("Leaving cluster will leave you with %v managers out of %v. This means Raft quorum will be lost and your cluster will become inaccessible. ", reachable-1, reachable+unreachable)
|
msg += fmt.Sprintf("Leaving the cluster will leave you with %v managers out of %v. This means Raft quorum will be lost and your cluster will become inaccessible. ", reachable-1, reachable+unreachable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg += "Doing so may lose the consensus of your cluster. "
|
msg += "Doing so may lose the consensus of your cluster. "
|
||||||
}
|
}
|
||||||
|
|
||||||
msg += "Only way to restore a cluster that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to ignore this message."
|
msg += "The only way to restore a cluster that has lost consensus is to reinitialize it with `--force-new-cluster`. Use `--force` to ignore this message."
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
return fmt.Errorf(msg)
|
return fmt.Errorf(msg)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue