Add more information for failing to get path or snapshot in restic backup and restore.

Signed-off-by: Xun Jiang <jxun@vmware.com>
pull/4988/head
Xun Jiang 2022-06-13 11:29:57 +08:00
parent fee46d4f38
commit 806234e043
4 changed files with 4 additions and 3 deletions

View File

@ -0,0 +1 @@
Add more information for failing to get path or snapshot in restic backup and restore.

View File

@ -211,7 +211,7 @@ func (r *PodVolumeBackupReconciler) singlePathMatch(path string) (string, error)
}
if len(matches) != 1 {
return "", errors.Errorf("expected one matching path, got %d", len(matches))
return "", errors.Errorf("expected one matching path: %s, got %d", path, len(matches))
}
return matches[0], nil

View File

@ -222,7 +222,7 @@ func singlePathMatch(path string) (string, error) {
}
if len(matches) != 1 {
return "", errors.Errorf("expected one matching path, got %d", len(matches))
return "", errors.Errorf("expected one matching path: %s, got %d", path, len(matches))
}
return matches[0], nil

View File

@ -63,7 +63,7 @@ func GetSnapshotID(snapshotIdCmd *Command) (string, error) {
}
if len(snapshots) != 1 {
return "", errors.Errorf("expected one matching snapshot, got %d", len(snapshots))
return "", errors.Errorf("expected one matching snapshot by command: %s, got %d", snapshotIdCmd.String(), len(snapshots))
}
return snapshots[0].ShortID, nil