disaster recovery: return error if no backup policy

This commit is contained in:
Hongchao Deng 2016-10-03 14:47:19 -07:00
Родитель 777e7ee930
Коммит 8c0db38421
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -162,6 +162,10 @@ func (c *Cluster) removeMember(toRemove *etcdutil.Member) error {
}
func (c *Cluster) disasterRecovery(left etcdutil.MemberSet) error {
if c.spec.Backup == nil {
return fmt.Errorf("fail to do disaster recovery for cluster (%s): no backup policy has been defined."+
" (TODO: Mark cluster as dead)", c.name)
}
httpClient := c.kclient.RESTClient.Client
resp, err := httpClient.Get(fmt.Sprintf("http://%s/backupnow", k8sutil.MakeBackupHostPort(c.name)))
if err != nil {