mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
Skip syncing the backup which doesn't contain backup metadata
Skip syncing the backup which doesn't contain backup metadata Fixes #6849 Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
@@ -142,6 +142,16 @@ func (b *backupSyncReconciler) Reconcile(ctx context.Context, req ctrl.Request)
|
||||
log = log.WithField("backup", backupName)
|
||||
log.Info("Attempting to sync backup into cluster")
|
||||
|
||||
exist, err := backupStore.BackupExists(location.Spec.ObjectStorage.Bucket, backupName)
|
||||
if err != nil {
|
||||
log.WithError(errors.WithStack(err)).Error("Error checking backup exist from backup store")
|
||||
continue
|
||||
}
|
||||
if !exist {
|
||||
log.Debugf("backup %s doesn't exist in backup store, skip", backupName)
|
||||
continue
|
||||
}
|
||||
|
||||
backup, err := backupStore.GetBackupMetadata(backupName)
|
||||
if err != nil {
|
||||
log.WithError(errors.WithStack(err)).Error("Error getting backup metadata from backup store")
|
||||
|
||||
Reference in New Issue
Block a user