Skip to content

Commit

Permalink
Avoid re-creating master pod if it is empty during sync. (#58)
Browse files Browse the repository at this point in the history
Fixes #59
  • Loading branch information
alexeyklyukin committed Jul 12, 2017
1 parent 0015071 commit a8ed1e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pkg/cluster/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ func (c *Cluster) recreatePods() error {
}
if masterPod.Name == "" {
c.logger.Warningln("No master pod in the cluster")
}

//TODO: do manual failover
//TODO: specify master, leave new master empty
c.logger.Infof("Recreating master pod '%s'", util.NameFromMeta(masterPod.ObjectMeta))
} else {
//TODO: do manual failover
//TODO: specify master, leave new master empty
c.logger.Infof("Recreating master pod '%s'", util.NameFromMeta(masterPod.ObjectMeta))

if err := c.recreatePod(masterPod); err != nil {
return fmt.Errorf("could not recreate master pod '%s': %v", util.NameFromMeta(masterPod.ObjectMeta), err)
if err := c.recreatePod(masterPod); err != nil {
return fmt.Errorf("could not recreate master pod '%s': %v", util.NameFromMeta(masterPod.ObjectMeta), err)
}
}

return nil
Expand Down

0 comments on commit a8ed1e2

Please sign in to comment.