mirror of https://github.com/docker/docs.git
Improve the warning messages when leaving a Swarm cluster
Signed-off-by: Anil Madhavapeddy <anil@docker.com> (cherry picked from commit 22a3d1fa209282e938ca16f31cce0dab4f35bf72) Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
6966df5de7
commit
b18cea6d0f
|
|
@ -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…
Reference in New Issue