From bfdbe6b04fbcee955a1665779ae429dc5a3c290e Mon Sep 17 00:00:00 2001 From: BornChanger Date: Tue, 25 Jul 2023 17:33:04 +0800 Subject: [PATCH] ebs br: fail delete cr operation if backup meta is missing Signed-off-by: BornChanger --- 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 }