Skip to content

Commit

Permalink
skip manual failover for 1-pod clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
mkabilov committed Oct 5, 2017
1 parent bd9b0b6 commit b95d220
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/cluster/pod.go
Expand Up @@ -146,9 +146,11 @@ func (c *Cluster) recreatePods() error {
if masterPod.Name == "" {
c.logger.Warningln("no master pod in the cluster")
} else {
err := c.ManualFailover(&masterPod, masterCandidate(replicas))
if err != nil {
return fmt.Errorf("could not perform manual failover: %v", err)
if len(replicas) > 0 {
err := c.ManualFailover(&masterPod, masterCandidate(replicas))
if err != nil {
return fmt.Errorf("could not perform manual failover: %v", err)
}
}
//TODO: specify master, leave new master empty
c.logger.Infof("recreating master pod %q", util.NameFromMeta(masterPod.ObjectMeta))
Expand Down

0 comments on commit b95d220

Please sign in to comment.