Skip to content

Commit

Permalink
ebs br: fail delete cr operation if backup meta is missing (#5199)
Browse files Browse the repository at this point in the history
Signed-off-by: BornChanger <dawn_catcher@126.com>
Co-authored-by: Xuecheng Zhang <csuzhangxc@gmail.com>
  • Loading branch information
BornChanger and csuzhangxc committed Jul 28, 2023
1 parent a0ef530 commit 87b2874
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/backup-manager/app/clean/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ func (bo *Options) deleteSnapshotsAndBackupMeta(ctx context.Context, backup *v1a
}()

contents, err := os.ReadFile(metaFile)

if errors.Is(err, os.ErrNotExist) {
klog.Warningf("read metadata file %s failed, err: %s, a mannual check or delete aciton require.", metaFile, err)
return nil
klog.Errorf("read metadata file %s failed, err: %s, a manual check or delete action required.", metaFile, err)
return err
} else if err != nil { // will retry it
klog.Warningf("read metadata file %s failed, err: %s", metaFile, err)
klog.Errorf("read metadata file %s failed, err: %s", metaFile, err)
return err
}

Expand Down

0 comments on commit 87b2874

Please sign in to comment.