diff --git a/pkg/cluster/pod.go b/pkg/cluster/pod.go index 49497d9298a0ecf8524f89279fa676dc2449990a..52ecdfffea266064834974b75ed227887bcd9f1c 100644 --- a/pkg/cluster/pod.go +++ b/pkg/cluster/pod.go @@ -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