Merge pull request #4988 from blackpiglet/add-more-info-for-get-path-or-snapshot-fail-by-restic

Add more information for failing to get path or snapshot in restic ba…
This commit is contained in:
qiuming
2022-06-13 14:38:41 +08:00
committed by GitHub
4 changed files with 4 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
Add more information for failing to get path or snapshot in restic backup and restore.
@@ -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
@@ -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
+1 -1
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