[Cherry-Pick]Fix error with Restic backup empty volumes

Signed-off-by: Ming <mqiu@vmware.com>
This commit is contained in:
Ming
2022-12-20 02:40:29 +00:00
parent 55873c1c37
commit 3b903e678f
2 changed files with 2 additions and 1 deletions

View File

@@ -0,0 +1 @@
Fix error with Restic backup empty volumes

View File

@@ -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
}