From 87b28741cf88bec658ff80745a21d13e0150409d Mon Sep 17 00:00:00 2001 From: BornChanger <97348524+BornChanger@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:01:01 +0800 Subject: [PATCH] ebs br: fail delete cr operation if backup meta is missing (#5199) Signed-off-by: BornChanger Co-authored-by: Xuecheng Zhang --- cmd/backup-manager/app/clean/clean.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/backup-manager/app/clean/clean.go b/cmd/backup-manager/app/clean/clean.go index 7fb588c7d0..9255c65ec1 100644 --- a/cmd/backup-manager/app/clean/clean.go +++ b/cmd/backup-manager/app/clean/clean.go @@ -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 }