Fail backup if it already exists in object storage

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2018-06-29 13:54:44 -04:00
committed by Carlisia
parent 134323fbf7
commit 01d0b026e9
18 changed files with 640 additions and 72 deletions

View File

@@ -158,11 +158,16 @@ func (c *backupController) processBackup(key string) error {
log.Debug("Running processBackup")
ns, name, err := cache.SplitMetaNamespaceKey(key)
if err != nil {
return errors.Wrap(err, "error splitting queue key")
logContext.WithError(err).Errorf("error splitting key")
return nil
}
log.Debug("Getting backup")
original, err := c.lister.Backups(ns).Get(name)
if apierrors.IsNotFound(err) {
log.Debug("backup not found")
return nil
}
if err != nil {
return errors.Wrap(err, "error getting backup")
}