1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-01 15:19:09 +00:00

update log message for validate node count

This commit is contained in:
galal-hussein 2018-08-29 23:49:01 +02:00 committed by Alena Prokharchyk
parent d451683abb
commit 6b141295aa

View File

@ -128,7 +128,14 @@ func validateIngressOptions(c *Cluster) error {
func ValidateHostCount(c *Cluster) error {
if len(c.EtcdHosts) == 0 && len(c.Services.Etcd.ExternalURLs) == 0 {
return fmt.Errorf("Cluster must have at least one etcd plane host")
failedEtcdHosts := []string{}
for _, host := range c.InactiveHosts {
if host.IsEtcd {
failedEtcdHosts = append(failedEtcdHosts, host.Address)
}
return fmt.Errorf("Cluster must have at least one etcd plane host: failed to connect to the following etcd host(s) %v", failedEtcdHosts)
}
return fmt.Errorf("Cluster must have at least one etcd plane host: please specify one or more etcd in cluster config")
}
if len(c.EtcdHosts) > 0 && len(c.Services.Etcd.ExternalURLs) > 0 {
return fmt.Errorf("Cluster can't have both internal and external etcd")