guard against joining the cluster twice

pull/8858/head
Sharif Elgamal 2020-07-28 12:16:33 -07:00
parent b602ae44bd
commit 2cc7445f1c
1 changed files with 5 additions and 1 deletions

View File

@ -654,7 +654,11 @@ func (k *Bootstrapper) JoinCluster(cc config.ClusterConfig, n config.Node, joinC
out, err := k.c.RunCmd(exec.Command("/bin/bash", "-c", joinCmd))
if err != nil {
return errors.Wrapf(err, "cmd failed: %s\n%+v\n", joinCmd, out.Output())
if strings.Contains(err.Error(), "status \"Ready\" already exists in the cluster") {
glog.Infof("Node %s already joined the cluster, skip failure.", n.Name)
} else {
return errors.Wrapf(err, "cmd failed: %s\n%+v\n", joinCmd, out.Output())
}
}
return nil
}