From 3b903e678fe91c858c1f7d2726e9090d746278e1 Mon Sep 17 00:00:00 2001 From: Ming Date: Tue, 20 Dec 2022 02:40:29 +0000 Subject: [PATCH] [Cherry-Pick]Fix error with Restic backup empty volumes Signed-off-by: Ming --- changelogs/unreleased/5713-qiuming-best | 1 + pkg/uploader/provider/restic.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/5713-qiuming-best diff --git a/changelogs/unreleased/5713-qiuming-best b/changelogs/unreleased/5713-qiuming-best new file mode 100644 index 000000000..c63b47030 --- /dev/null +++ b/changelogs/unreleased/5713-qiuming-best @@ -0,0 +1 @@ +Fix error with Restic backup empty volumes diff --git a/pkg/uploader/provider/restic.go b/pkg/uploader/provider/restic.go index 00fe42057..70ae4823c 100644 --- a/pkg/uploader/provider/restic.go +++ b/pkg/uploader/provider/restic.go @@ -137,7 +137,7 @@ func (rp *resticProvider) RunBackup( summary, stderrBuf, err := restic.RunBackup(backupCmd, log, updater) if err != nil { - if strings.Contains(err.Error(), "snapshot is empty") { + if strings.Contains(stderrBuf, "snapshot is empty") { log.Debugf("Restic backup got empty dir with %s path", path) return "", true, nil }