Skip to content
Snippets Groups Projects
Commit 3b8c0641 authored by Murat Kabilov's avatar Murat Kabilov Committed by GitHub
Browse files

skip manual failover for 1-pod clusters

parent bd9b0b61
No related branches found
No related tags found
No related merge requests found
...@@ -146,10 +146,12 @@ func (c *Cluster) recreatePods() error { ...@@ -146,10 +146,12 @@ func (c *Cluster) recreatePods() error {
if masterPod.Name == "" { if masterPod.Name == "" {
c.logger.Warningln("no master pod in the cluster") c.logger.Warningln("no master pod in the cluster")
} else { } else {
if len(replicas) > 0 {
err := c.ManualFailover(&masterPod, masterCandidate(replicas)) err := c.ManualFailover(&masterPod, masterCandidate(replicas))
if err != nil { if err != nil {
return fmt.Errorf("could not perform manual failover: %v", err) return fmt.Errorf("could not perform manual failover: %v", err)
} }
}
//TODO: specify master, leave new master empty //TODO: specify master, leave new master empty
c.logger.Infof("recreating master pod %q", util.NameFromMeta(masterPod.ObjectMeta)) c.logger.Infof("recreating master pod %q", util.NameFromMeta(masterPod.ObjectMeta))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment