Skip to content

Commit

Permalink
Fix DataDownload fails during restore for empty PVC workload
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Qiu <mqiu@vmware.com>
  • Loading branch information
qiuming-best committed Mar 14, 2024
1 parent 84c1eca commit 8b5c983
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelogs/unreleased/7521-qiuming-best
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix DataDownload fails during restore for empty PVC workload

10 changes: 0 additions & 10 deletions pkg/uploader/kopia/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,6 @@ func Backup(ctx context.Context, fsUploader SnapshotUploader, repoWriter repo.Re
return nil, false, errors.Wrapf(err, "Invalid source path '%s'", sourcePath)
}

if volMode == uploader.PersistentVolumeFilesystem {
// to be consistent with restic when backup empty dir returns one error for upper logic handle
dirs, err := os.ReadDir(source)
if err != nil {
return nil, false, errors.Wrapf(err, "Unable to read dir in path %s", source)
} else if len(dirs) == 0 {
return nil, true, nil
}
}

source = filepath.Clean(source)

sourceInfo := snapshot.SourceInfo{
Expand Down

0 comments on commit 8b5c983

Please sign in to comment.